clevertap-react-native 0.9.5 → 0.9.6

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,5 +1,15 @@
1
1
  Change Log
2
2
  ==========
3
+
4
+ Version 0.9.6 *(3 April 2023)*
5
+ -------------------------------------------
6
+ - Supports [CleverTap Android SDK v4.6.9](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-468-march-22-2023)
7
+ - Supports [CleverTap iOS SDK v4.2.2](https://github.com/CleverTap/clevertap-ios-sdk/blob/master/CHANGELOG.md#version-422-april-03-2023)
8
+ - **[Breaking Change]**: Renames the `itemIndex` field with the `contentPageIndex` field in the payload of the `CleverTap.CleverTapInboxMessageTapped` callback.
9
+ - **[Parity with iOS platform]**:
10
+ 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.
11
+ - **[Type Definitions support in typescript]**: Supports type definitions for the event names that are available for Javascript.
12
+
3
13
  Version 0.9.5 *(27 March 2023)*
4
14
  -------------------------------------------
5
15
  - 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 +18,7 @@ Version 0.9.5 *(27 March 2023)*
8
18
  - 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
19
  - Make sure you update all four above versions for compatibility and smooth working.
10
20
  - **Note:** This release is being done for Android 12 targeted users.
11
- - **[Android and iOS Platforms]**:
21
+ - **[Android and iOS platforms]**:
12
22
  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
23
  - **[Android Platform] Behavioral change of `CleverTap.CleverTapInboxMessageTapped` listener**:
14
24
  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.
@@ -22,7 +22,7 @@ android {
22
22
  minSdkVersion 16
23
23
  targetSdkVersion 31
24
24
  versionCode 95
25
- versionName "0.9.5"
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.8'
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 itemIndex, int buttonIndex) {
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("itemIndex", itemIndex);
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.1'
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.8'
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 : string;
643
- export const XPS : string;
644
- export const BPS : string;
645
- export const HPS : string;
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[@"itemIndex"] = @(index);
650
+ body[@"contentPageIndex"] = @(index);
651
651
  body[@"buttonIndex"] = @(buttonIndex);
652
652
 
653
653
  [[NSNotificationCenter defaultCenter] postNotificationName:kCleverTapInboxMessageTapped object:nil userInfo:body];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clevertap-react-native",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "description": "CleverTap React Native SDK.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",