clevertap-react-native 0.9.5 → 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 +15 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/clevertap/react/CleverTapModule.java +2 -2
- package/clevertap-react-native.podspec +1 -1
- package/docs/install.md +1 -1
- package/docs/usage.md +17 -0
- package/index.d.ts +18 -4
- package/ios/CleverTapReact/CleverTapReact.m +1 -1
- package/ios/CleverTapReact/CleverTapReactManager.h +1 -0
- package/ios/CleverTapReact/CleverTapReactManager.m +24 -3
- package/ios/CleverTapReact/CleverTapSDK.framework.zip +0 -0
- package/ios/CleverTapReact.xcodeproj/project.xcworkspace/xcuserdata/kushagra.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
==========
|
|
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
|
+
|
|
8
|
+
Version 0.9.6 *(3 April 2023)*
|
|
9
|
+
-------------------------------------------
|
|
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)
|
|
11
|
+
- Supports [CleverTap iOS SDK v4.2.2](https://github.com/CleverTap/clevertap-ios-sdk/blob/master/CHANGELOG.md#version-422-april-03-2023)
|
|
12
|
+
- **[Breaking Change]**: Renames the `itemIndex` field with the `contentPageIndex` field in the payload of the `CleverTap.CleverTapInboxMessageTapped` callback.
|
|
13
|
+
- **[Parity with iOS platform]**:
|
|
14
|
+
The `CleverTap.CleverTapInboxMessageTapped` callback now provides a different value for `contentPageIndex`(ex-`itemIndex`) compared to before. Previously, it used to indicate the position of the clicked item within the list container of the App Inbox. However, now it indicates the page index of the content, which ranges from 0 to the total number of pages for carousel templates. For non-carousel templates, the value is always 0, as they only have one page of content.
|
|
15
|
+
- **[Type Definitions support in typescript]**: Supports type definitions for the event names that are available for Javascript.
|
|
16
|
+
|
|
3
17
|
Version 0.9.5 *(27 March 2023)*
|
|
4
18
|
-------------------------------------------
|
|
5
19
|
- Supports [CleverTap Android SDK v4.6.8](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-468-march-22-2023)
|
|
@@ -8,7 +22,7 @@ Version 0.9.5 *(27 March 2023)*
|
|
|
8
22
|
- Supports [CleverTap Push Templates SDK v1.0.5.1](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTPUSHTEMPLATESCHANGELOG.md#version-1051-march-15-2023).
|
|
9
23
|
- Make sure you update all four above versions for compatibility and smooth working.
|
|
10
24
|
- **Note:** This release is being done for Android 12 targeted users.
|
|
11
|
-
- **[Android and iOS
|
|
25
|
+
- **[Android and iOS platforms]**:
|
|
12
26
|
Adds `itemIndex` and `buttonIndex` arguments to the payload sent via App Inbox Message tapped listener: `CleverTap.CleverTapInboxMessageTapped`. The `itemIndex` corresponds the index of the item clicked in the list whereas the `buttonIndex` for the App Inbox button clicked (0, 1, or 2). A value of -1 in `buttonIndex` indicates the App Inbox item is clicked.
|
|
13
27
|
- **[Android Platform] Behavioral change of `CleverTap.CleverTapInboxMessageTapped` listener**:
|
|
14
28
|
Previously, the callback was raised when the App Inbox item is clicked. Now, it is also raised when the App Inbox button is clicked. It matches the behavior in iOS platform.
|
package/android/build.gradle
CHANGED
|
@@ -22,7 +22,7 @@ android {
|
|
|
22
22
|
minSdkVersion 16
|
|
23
23
|
targetSdkVersion 31
|
|
24
24
|
versionCode 95
|
|
25
|
-
versionName "0.9.
|
|
25
|
+
versionName "0.9.6"
|
|
26
26
|
}
|
|
27
27
|
buildTypes {
|
|
28
28
|
release {
|
|
@@ -39,7 +39,7 @@ dependencies {
|
|
|
39
39
|
maven { url "$rootDir/../node_modules/react-native/android" }
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
api 'com.clevertap.android:clevertap-android-sdk:4.6.
|
|
42
|
+
api 'com.clevertap.android:clevertap-android-sdk:4.6.9'
|
|
43
43
|
implementation 'com.android.installreferrer:installreferrer:2.2'
|
|
44
44
|
//compile 'com.android.support:appcompat-v7:28.0.0'
|
|
45
45
|
implementation 'com.facebook.react:react-native:+'
|
|
@@ -731,13 +731,13 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
731
731
|
}
|
|
732
732
|
|
|
733
733
|
@Override
|
|
734
|
-
public void onInboxItemClicked(CTInboxMessage message, int
|
|
734
|
+
public void onInboxItemClicked(CTInboxMessage message, int contentPageIndex, int buttonIndex) {
|
|
735
735
|
WritableMap params = Arguments.createMap();
|
|
736
736
|
JSONObject data = message.getData();
|
|
737
737
|
if (data != null) {
|
|
738
738
|
params.putString("data", data.toString());
|
|
739
739
|
}
|
|
740
|
-
params.putInt("
|
|
740
|
+
params.putInt("contentPageIndex", contentPageIndex);
|
|
741
741
|
params.putInt("buttonIndex", buttonIndex);
|
|
742
742
|
sendEvent(CLEVERTAP_ON_INBOX_MESSAGE_CLICK, params);
|
|
743
743
|
}
|
|
@@ -18,6 +18,6 @@ Pod::Spec.new do |s|
|
|
|
18
18
|
s.preserve_paths = 'LICENSE.md', 'README.md', 'package.json', 'index.js'
|
|
19
19
|
s.source_files = 'ios/CleverTapReact/*.{h,m}'
|
|
20
20
|
|
|
21
|
-
s.dependency 'CleverTap-iOS-SDK', '4.2.
|
|
21
|
+
s.dependency 'CleverTap-iOS-SDK', '4.2.2'
|
|
22
22
|
s.dependency 'React-Core'
|
|
23
23
|
end
|
package/docs/install.md
CHANGED
|
@@ -86,7 +86,7 @@ dependencies {
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
//clevertap
|
|
89
|
-
implementation 'com.clevertap.android:clevertap-android-sdk:4.6.
|
|
89
|
+
implementation 'com.clevertap.android:clevertap-android-sdk:4.6.9'
|
|
90
90
|
implementation "com.clevertap.android:push-templates:1.0.5.1" //Optional for push templates SDK support
|
|
91
91
|
implementation "com.clevertap.android:clevertap-rendermax-sdk:1.0.3" //Optional for renderMax SDK support
|
|
92
92
|
|
package/docs/usage.md
CHANGED
|
@@ -104,6 +104,23 @@ CleverTap.showInbox({'tabs':['Offers','Promotions'],'navBarTitle':'My App Inbox'
|
|
|
104
104
|
'noMessageText':'No message(s)','noMessageTextColor':'#FF0000'});
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
+
#### App Inbox Item Click Callback
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
CleverTap.addListener(CleverTap.CleverTapInboxMessageTapped, (event) => {
|
|
111
|
+
console.log("App Inbox item : ", event.data);
|
|
112
|
+
//following contentPageIndex and buttonIndex fields are available from CleverTap React Native SDK v0.9.6 onwards and below v1.0.0
|
|
113
|
+
console.log("Item index : " + event.contentPageIndex);
|
|
114
|
+
console.log("Button index : " + event.buttonIndex);
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
#### App Inbox Button Click Callback
|
|
120
|
+
```javascript
|
|
121
|
+
CleverTap.addListener(CleverTap.CleverTapInboxMessageButtonTapped, (event) => {/*consume the payload*/});
|
|
122
|
+
```
|
|
123
|
+
|
|
107
124
|
#### Dismiss the App Inbox
|
|
108
125
|
```javascript
|
|
109
126
|
CleverTap.dismissInbox();
|
package/index.d.ts
CHANGED
|
@@ -639,7 +639,21 @@
|
|
|
639
639
|
type Callback = (err: object, res: object) => void;
|
|
640
640
|
type CallbackString = (err: object, res: string) => void;
|
|
641
641
|
|
|
642
|
-
export const FCM
|
|
643
|
-
export const XPS
|
|
644
|
-
export const BPS
|
|
645
|
-
export const HPS
|
|
642
|
+
export const FCM: string;
|
|
643
|
+
export const XPS: string;
|
|
644
|
+
export const BPS: string;
|
|
645
|
+
export const HPS: string;
|
|
646
|
+
export const CleverTapProfileDidInitialize: string;
|
|
647
|
+
export const CleverTapProfileSync: string;
|
|
648
|
+
export const CleverTapInAppNotificationDismissed: string;
|
|
649
|
+
export const CleverTapInboxDidInitialize: string;
|
|
650
|
+
export const CleverTapInboxMessagesDidUpdate: string;
|
|
651
|
+
export const CleverTapInboxMessageButtonTapped: string;
|
|
652
|
+
export const CleverTapInboxMessageTapped: string;
|
|
653
|
+
export const CleverTapDisplayUnitsLoaded: string;
|
|
654
|
+
export const CleverTapInAppNotificationButtonTapped: string;
|
|
655
|
+
export const CleverTapFeatureFlagsDidUpdate: string;
|
|
656
|
+
export const CleverTapProductConfigDidInitialize: string;
|
|
657
|
+
export const CleverTapProductConfigDidFetch: string;
|
|
658
|
+
export const CleverTapProductConfigDidActivate: string;
|
|
659
|
+
export const CleverTapPushNotificationClicked: string;
|
|
@@ -647,7 +647,7 @@ RCT_EXPORT_METHOD(showInbox:(NSDictionary*)styleConfig) {
|
|
|
647
647
|
if ([message json] != nil) {
|
|
648
648
|
body[@"data"] = [NSMutableDictionary dictionaryWithDictionary:[message json]];
|
|
649
649
|
}
|
|
650
|
-
body[@"
|
|
650
|
+
body[@"contentPageIndex"] = @(index);
|
|
651
651
|
body[@"buttonIndex"] = @(buttonIndex);
|
|
652
652
|
|
|
653
653
|
[[NSNotificationCenter defaultCenter] postNotificationName:kCleverTapInboxMessageTapped object:nil userInfo:body];
|
|
@@ -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
|
|
55
|
-
self.
|
|
56
|
-
|
|
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
|
|
Binary file
|
|
Binary file
|