From bd05734f228d41d7ce20d5b209025cc27e7e0b85 Mon Sep 17 00:00:00 2001 From: anush Date: Thu, 4 Apr 2024 23:58:42 +0530 Subject: [PATCH 1/6] task(SDK-3753) - Removes manifest entry for CTBackgroundJobService - No longer required as it is fixed in v6.2.0 --- android/src/main/AndroidManifest.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 7343e0cf..0ceeb8b0 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,10 +1,4 @@ - + - From 44ea9aabf07e51f46ffe88f51353fc8cf49b7fa1 Mon Sep 17 00:00:00 2001 From: anush Date: Fri, 5 Apr 2024 00:01:28 +0530 Subject: [PATCH 2/6] task(SDK-3752) - Updates Example app --- Example/App.js | 1 - Example/android/app/build.gradle | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Example/App.js b/Example/App.js index 48601d26..eb2256bb 100644 --- a/Example/App.js +++ b/Example/App.js @@ -1157,7 +1157,6 @@ pushFcmRegistrationId = () => { // => https://developer.clevertap.com/docs/android#section-custom-android-push-notifications-handling CleverTap.setPushToken('1000test000token000fcm', CleverTap.FCM); //CleverTap.setPushToken("111056687894", CleverTap.HMS);//for Huawei push - CleverTap.setPushToken('1000test000token000xps', CleverTap.XPS, 'Europe'); //for Xiaomi push //CleverTap.setPushToken("111056687894", CleverTap.BPS);//for Baidu push } }; diff --git a/Example/android/app/build.gradle b/Example/android/app/build.gradle index 387179cd..8ec8f2c8 100644 --- a/Example/android/app/build.gradle +++ b/Example/android/app/build.gradle @@ -218,7 +218,7 @@ dependencies { //clevertap - implementation 'com.clevertap.android:clevertap-android-sdk:6.1.1' + implementation 'com.clevertap.android:clevertap-android-sdk:6.2.0' implementation "com.clevertap.android:push-templates:1.2.3" implementation project(':clevertap-react-native') From 8625007c019b82978ccd4d037819624765ff0fa1 Mon Sep 17 00:00:00 2001 From: anush Date: Fri, 5 Apr 2024 00:02:39 +0530 Subject: [PATCH 3/6] task(SDK-3752) - Adds support for ctv6.2.0 - Updates versions - Removes all xiaomi related code --- CHANGELOG.md | 24 ++++++++++++++++++- .../java/com/reactnct/MainApplication.java | 3 --- android/build.gradle | 6 ++--- .../com/clevertap/react/CleverTapModule.java | 21 ---------------- index.d.ts | 6 ++--- index.js | 17 ++++--------- package.json | 2 +- 7 files changed, 34 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1253c38..26f8eeaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,30 @@ Change Log ========== - +Version 2.2.0 *(5 April 2024)* +------------------------------------------- **What's new** +* **[Android Platform]** + * Supports [CleverTap Android SDK v6.2.0](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-620-april-3-2024). + +* **[iOS Platform]** + * Supports [CleverTap iOS SDK v6.2.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/6.1.0). + +**API Changes** + * Removes all Xiaomi related public methods as the Xiaomi SDK has been discontinued. Details [here](https://developer.clevertap.com/docs/discontinuation-of-xiaomi-push-service). + * Changes the function definition of `setPushToken` to `setPushToken: function (token, type)` i.e it no more accepts `region` as a parameter. + +**Bug Fixes** +* **[Android Platform]** + * Extends the push primer callback to notify permission denial when cancel button is clicked on PromptForSettings alert dialog. + * Fixes a crash due to NullPointerException related to deviceInfo.deviceId. + * Fixes an ANR related to isMainProcess check. + * Fixes an ANR due to eager initialisation of CtApi triggered by DeviceId generation. + +* **[iOS Platform]** + * Fixes a bug where client side in-apps were not discarded when rendering status is set to "discard". + + Version 2.1.0 *(7 March 2024)* ------------------------------------------- **What's new** diff --git a/Example/android/app/src/main/java/com/reactnct/MainApplication.java b/Example/android/app/src/main/java/com/reactnct/MainApplication.java index 73dc7bbb..6406de3c 100644 --- a/Example/android/app/src/main/java/com/reactnct/MainApplication.java +++ b/Example/android/app/src/main/java/com/reactnct/MainApplication.java @@ -70,9 +70,6 @@ public ReactNativeHost getReactNativeHost() { @Override public void onCreate() { CleverTapAPI.setDebugLevel(LogLevel.VERBOSE); - // you can use below two xiaomi related methods from clevertap-react-native 0.9.0 onwards - //CleverTapAPI.changeXiaomiCredentials("your xiaomi app id","your xiaomi app key") - //CleverTapAPI.enableXiaomiPushOn(XIAOMI_MIUI_DEVICES) CleverTapAPI.setNotificationHandler((NotificationHandler) new PushTemplateNotificationHandler()); CleverTapAPI.getDefaultInstance(getApplicationContext()).enableDeviceNetworkInfoReporting(true); registerActivityLifecycleCallbacks(this); diff --git a/android/build.gradle b/android/build.gradle index 62c4f9b5..265d42a5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -20,8 +20,8 @@ android { defaultConfig { minSdkVersion 19 targetSdkVersion 34 - versionCode 210 - versionName "2.1.0" + versionCode 220 + versionName "2.2.0" } namespace 'com.clevertap.react' @@ -40,7 +40,7 @@ dependencies { maven { url "$rootDir/../node_modules/react-native/android" } } - api 'com.clevertap.android:clevertap-android-sdk:6.1.1' + api 'com.clevertap.android:clevertap-android-sdk:6.2.0' implementation 'com.android.installreferrer:installreferrer:2.2' //compile 'com.android.support:appcompat-v7:28.0.0' implementation 'com.facebook.react:react-native:+' diff --git a/android/src/main/java/com/clevertap/react/CleverTapModule.java b/android/src/main/java/com/clevertap/react/CleverTapModule.java index 680a05e7..d1dec2e6 100644 --- a/android/src/main/java/com/clevertap/react/CleverTapModule.java +++ b/android/src/main/java/com/clevertap/react/CleverTapModule.java @@ -1353,27 +1353,6 @@ public void setPushTokenAsString(String token, String type) { } } - @ReactMethod - public void setPushTokenAsStringWithRegion(String token, String type, String region) { - Logger.v("setPushTokenAsString() called with: token = [" + token + "], type = [" + type + "], region = [" - + region + "]"); - - CleverTapAPI clevertap = getCleverTapAPI(); - if (clevertap == null || token == null || type == null || TextUtils.isEmpty(region)) { - return; - } - - switch (type) { - case XPS: - clevertap.pushXiaomiRegistrationId(token, region, true); - break; - default: - Log.e(TAG, "Unknown push token type " + type); - break; - } - } - - @ReactMethod public void showInbox(ReadableMap styleConfig) { CTInboxStyleConfig inboxStyleConfig = styleConfigFromReadableMap(styleConfig); diff --git a/index.d.ts b/index.d.ts index 00fd84b9..e37e678b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -72,10 +72,9 @@ /** * Manually set the push token on the CleverTap user profile * @param {string} token - the device token - * @param {string} type - for Android only, specifying the type of push service token. Values can be CleverTap.FCM for Firebase or CleverTap.XPS for Xiaomi or CleverTap.BPS for Baidu or CleverTap.HPS for Huawei, - * @param {string} region - for xps only ,to specify the region + * @param {string} type - for Android only, specifying the type of push service token. Values can be CleverTap.FCM for Firebase or CleverTap.BPS for Baidu or CleverTap.HPS for Huawei, */ - export function setPushToken(token: string, type: string,region?:string): void; + export function setPushToken(token: string, type: string): void; /** * Create Notification Channel for Android O+ @@ -784,7 +783,6 @@ export function isPushPermissionGranted(callback: CallbackString): void; type CallbackString = (err: object, res: string) => void; export const FCM: string; - export const XPS: string; export const BPS: string; export const HPS: string; export const CleverTapProfileDidInitialize: string; diff --git a/index.js b/index.js index 13ba6225..d22a2b02 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ const EventEmitter = NativeModules.CleverTapReactEventEmitter ? new NativeEventE * @param {int} libVersion - The updated library version. If current version is 1.1.0 then pass as 10100 */ const libName = 'React-Native'; -const libVersion = 20100; +const libVersion = 20200; CleverTapReact.setLibrary(libName,libVersion); function defaultCallback(method, err, res) { @@ -49,7 +49,6 @@ var CleverTap = { CleverTapInAppNotificationDismissed: CleverTapReact.CleverTapInAppNotificationDismissed, CleverTapInAppNotificationShowed: CleverTapReact.CleverTapInAppNotificationShowed, FCM: CleverTapReact.FCM, - XPS: CleverTapReact.XPS, BPS: CleverTapReact.BPS, HPS: CleverTapReact.HPS, CleverTapInboxDidInitialize: CleverTapReact.CleverTapInboxDidInitialize, @@ -128,17 +127,11 @@ var CleverTap = { /** * Manually set the push token on the CleverTap user profile * @param {string} token - the device token - * @param {string} type - for Android only, specifying the type of push service token. Values can be CleverTap.FCM for Firebase or CleverTap.XPS for Xiaomi or CleverTap.BPS for Baidu or CleverTap.HPS for Huawei, - * @param {string} region - for xps only ,to specify the region + * @param {string} type - for Android only, specifying the type of push service token. Values can be CleverTap.FCM for Firebase or CleverTap.BPS for Baidu or CleverTap.HPS for Huawei, */ - setPushToken: function (token, type, region = "") { - console.log(`CleverTap RN | setPushToken | received : token: '${token}' | type:'${type}' | region:'${region}' `) - if (type === CleverTap.XPS) { - CleverTapReact.setPushTokenAsStringWithRegion(token, type, region); - } - else { - CleverTapReact.setPushTokenAsString(token, type); - } + setPushToken: function (token, type) { + console.log(`CleverTap RN | setPushToken | received : token: '${token}' | type:'${type}' `) + CleverTapReact.setPushTokenAsString(token, type); }, /** diff --git a/package.json b/package.json index d929ffea..d9469332 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clevertap-react-native", - "version": "2.1.0", + "version": "2.2.0", "description": "CleverTap React Native SDK.", "main": "index.js", "types": "index.d.ts", From 11afe2c78bf040312744c15d27c4d43300a9308f Mon Sep 17 00:00:00 2001 From: anush Date: Fri, 5 Apr 2024 10:36:37 +0530 Subject: [PATCH 4/6] task(SDK-3752) - Fixes a typo in CHANGELOG.md --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26f8eeaa..c9a4e174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Version 2.2.0 *(5 April 2024)* * Supports [CleverTap Android SDK v6.2.0](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-620-april-3-2024). * **[iOS Platform]** - * Supports [CleverTap iOS SDK v6.2.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/6.1.0). + * Supports [CleverTap iOS SDK v6.2.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/6.2.0). **API Changes** * Removes all Xiaomi related public methods as the Xiaomi SDK has been discontinued. Details [here](https://developer.clevertap.com/docs/discontinuation-of-xiaomi-push-service). @@ -16,10 +16,10 @@ Version 2.2.0 *(5 April 2024)* **Bug Fixes** * **[Android Platform]** - * Extends the push primer callback to notify permission denial when cancel button is clicked on PromptForSettings alert dialog. - * Fixes a crash due to NullPointerException related to deviceInfo.deviceId. - * Fixes an ANR related to isMainProcess check. - * Fixes an ANR due to eager initialisation of CtApi triggered by DeviceId generation. + * Extends the push primer callback to notify permission denial when cancel button is clicked on `PromptForSettings` alert dialog. + * Fixes a crash due to `NullPointerException` related to `deviceInfo.deviceId`. + * Fixes an ANR related to `isMainProcess` check. + * Fixes an ANR due to eager initialisation of `CtApi` triggered by DeviceId generation. * **[iOS Platform]** * Fixes a bug where client side in-apps were not discarded when rendering status is set to "discard". From 86ef86ef9ae8302686a7250e0bfbaa1ec0a7042b Mon Sep 17 00:00:00 2001 From: anush Date: Fri, 5 Apr 2024 11:58:18 +0530 Subject: [PATCH 5/6] task(SDK-3752) - Adds back package name for max compatibility with RN versions https://github.com/react-native-community/discussions-and-proposals/issues/671#issuecomment-1597386954OV --- CHANGELOG.md | 1 + android/src/main/AndroidManifest.xml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9a4e174..ed14c630 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Version 2.2.0 *(5 April 2024)* * Fixes a crash due to `NullPointerException` related to `deviceInfo.deviceId`. * Fixes an ANR related to `isMainProcess` check. * Fixes an ANR due to eager initialisation of `CtApi` triggered by DeviceId generation. + * Fixes an android build issue related to `package name no found` for apps with ReactNative version less than 0.71 * **[iOS Platform]** * Fixes a bug where client side in-apps were not discarded when rendering status is set to "discard". diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 0ceeb8b0..f813cf33 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,4 +1,8 @@ - + + From d41322e8aa6c9aac6516e4d8198d775c6596da0f Mon Sep 17 00:00:00 2001 From: anush Date: Fri, 5 Apr 2024 12:11:58 +0530 Subject: [PATCH 6/6] task(SDK-3752) - Updates CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed14c630..41d359f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Version 2.2.0 *(5 April 2024)* * **[iOS Platform]** * Supports [CleverTap iOS SDK v6.2.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/6.2.0). + * Updates privacy manifests. **API Changes** * Removes all Xiaomi related public methods as the Xiaomi SDK has been discontinued. Details [here](https://developer.clevertap.com/docs/discontinuation-of-xiaomi-push-service). @@ -20,7 +21,7 @@ Version 2.2.0 *(5 April 2024)* * Fixes a crash due to `NullPointerException` related to `deviceInfo.deviceId`. * Fixes an ANR related to `isMainProcess` check. * Fixes an ANR due to eager initialisation of `CtApi` triggered by DeviceId generation. - * Fixes an android build issue related to `package name no found` for apps with ReactNative version less than 0.71 + * Fixes an android build issue related to `package name no found` for apps with ReactNative version less than 0.71. * **[iOS Platform]** * Fixes a bug where client side in-apps were not discarded when rendering status is set to "discard".