clevertap-react-native 0.9.6 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Change Log
2
2
  ==========
3
3
 
4
+ Version 0.9.7 *(3rd May 2023)*
5
+ -------------------------------------------
6
+ - Fixes a bug where notification clicked callbacks were not working for killed state in iOS.
7
+
4
8
  Version 0.9.6 *(3 April 2023)*
5
9
  -------------------------------------------
6
10
  - Supports [CleverTap Android SDK v4.6.9](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-468-march-22-2023)
@@ -9,6 +9,7 @@
9
9
 
10
10
  - (void)setDelegates:(CleverTap *)cleverTapInstance;
11
11
 
12
+ @property(nonatomic, strong) NSDictionary *pendingPushNotificationExtras;
12
13
  @property NSString *launchDeepLink;
13
14
 
14
15
  @end
@@ -3,6 +3,9 @@
3
3
 
4
4
  #import <UIKit/UIKit.h>
5
5
  #import <React/RCTLog.h>
6
+ #import <React/RCTBridge.h>
7
+ #import <React/RCTEventDispatcher.h>
8
+ #import <React/RCTRootView.h>
6
9
 
7
10
  #import "CleverTap+Inbox.h"
8
11
  #import "CleverTapUTMDetail.h"
@@ -33,6 +36,10 @@
33
36
  - (instancetype)init {
34
37
  self = [super init];
35
38
  if (self) {
39
+ [[NSNotificationCenter defaultCenter] addObserver:self
40
+ selector:@selector(handleContentDidAppearNotification:)
41
+ name:RCTContentDidAppearNotification
42
+ object:nil];
36
43
  CleverTap *clevertap = [CleverTap sharedInstance];
37
44
  [self setDelegates:clevertap];
38
45
  }
@@ -51,9 +58,12 @@
51
58
 
52
59
  - (void)applicationDidLaunchWithOptions:(NSDictionary *)options {
53
60
  NSDictionary *notification = [options valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
54
- if (notification && notification[@"wzrk_dl"]) {
55
- self.launchDeepLink = notification[@"wzrk_dl"];
56
- RCTLogInfo(@"CleverTapReact: setting launch deeplink: %@", self.launchDeepLink);
61
+ if (notification){
62
+ self.pendingPushNotificationExtras = notification;
63
+ if (notification[@"wzrk_dl"]) {
64
+ self.launchDeepLink = notification[@"wzrk_dl"];
65
+ RCTLogInfo(@"CleverTapReact: setting launch deeplink: %@", self.launchDeepLink);
66
+ }
57
67
  }
58
68
  }
59
69
 
@@ -149,4 +159,15 @@
149
159
  [self postNotificationWithName:kCleverTapProductConfigDidInitialize andBody:nil];
150
160
  }
151
161
 
162
+ - (void)handleContentDidAppearNotification:(NSNotification *)notification {
163
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
164
+
165
+ NSMutableDictionary *pushNotificationExtras = [NSMutableDictionary new];
166
+ NSDictionary *customExtras = self.pendingPushNotificationExtras;
167
+ if (customExtras != nil) {
168
+ pushNotificationExtras[@"customExtras"] = customExtras;
169
+ [self postNotificationWithName:kCleverTapPushNotificationClicked andBody:pushNotificationExtras];
170
+ }
171
+ }
172
+
152
173
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clevertap-react-native",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "CleverTap React Native SDK.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",