From a94ac6d254f5b30c084f731ca029a15790aef93f Mon Sep 17 00:00:00 2001 From: Aishwarya Nanna Date: Fri, 5 Apr 2024 09:36:54 +0530 Subject: [PATCH 1/4] - Support ct-ios-sdk v6.2.0 --- Example/ios/Podfile | 2 +- Example/package.json | 2 +- clevertap-react-native.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Example/ios/Podfile b/Example/ios/Podfile index af9b28b8..3dfd75c9 100644 --- a/Example/ios/Podfile +++ b/Example/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '13.0' +platform :ios, '14.0' target 'Example' do diff --git a/Example/package.json b/Example/package.json index 67b52de8..d05568e2 100644 --- a/Example/package.json +++ b/Example/package.json @@ -14,7 +14,7 @@ "@react-navigation/drawer": "^6.6.2", "@react-navigation/native": "^6.1.6", "@react-navigation/native-stack": "^6.9.12", - "clevertap-react-native": "git+https://github.com/CleverTap/clevertap-react-native#develop", + "clevertap-react-native": "git+https://github.com/CleverTap/clevertap-react-native#SDK-3749-Update_ct-ios-sdk_to_v6.2.0", "react": "18.2.0", "react-native": "0.73.5", "react-native-drawer": "^2.5.1", diff --git a/clevertap-react-native.podspec b/clevertap-react-native.podspec index 7c687d9a..46e6c81f 100644 --- a/clevertap-react-native.podspec +++ b/clevertap-react-native.podspec @@ -18,6 +18,6 @@ Pod::Spec.new do |s| s.preserve_paths = 'LICENSE.md', 'README.md', 'package.json', 'index.js' s.source_files = 'ios/CleverTapReact/*.{h,m}' - s.dependency 'CleverTap-iOS-SDK', '6.1.0' + s.dependency 'CleverTap-iOS-SDK', '6.2.0' s.dependency 'React-Core' end From c4098d3ea51051de0ecf57f1fb1254fdf4a43e7f Mon Sep 17 00:00:00 2001 From: Aishwarya Nanna Date: Fri, 5 Apr 2024 10:03:11 +0530 Subject: [PATCH 2/4] - Reverted branch to develop in package.json for Example app --- Example/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/package.json b/Example/package.json index d05568e2..67b52de8 100644 --- a/Example/package.json +++ b/Example/package.json @@ -14,7 +14,7 @@ "@react-navigation/drawer": "^6.6.2", "@react-navigation/native": "^6.1.6", "@react-navigation/native-stack": "^6.9.12", - "clevertap-react-native": "git+https://github.com/CleverTap/clevertap-react-native#SDK-3749-Update_ct-ios-sdk_to_v6.2.0", + "clevertap-react-native": "git+https://github.com/CleverTap/clevertap-react-native#develop", "react": "18.2.0", "react-native": "0.73.5", "react-native-drawer": "^2.5.1", From c2d8f5660560bae513a9ca98eb8c5f4c18476cca Mon Sep 17 00:00:00 2001 From: Anush-Shand <127097095+Anush-Shand@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:12:36 +0530 Subject: [PATCH 3/4] Task/sdk 3752/android support ctv6.2.0 (#386) * task(SDK-3753) - Removes manifest entry for CTBackgroundJobService - No longer required as it is fixed in v6.2.0 * task(SDK-3752) - Updates Example app * task(SDK-3752) - Adds support for ctv6.2.0 - Updates versions - Removes all xiaomi related code * task(SDK-3752) - Fixes a typo in CHANGELOG.md * 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 * task(SDK-3752) - Updates CHANGELOG.md --- CHANGELOG.md | 26 ++++++++++++++++++- Example/App.js | 1 - Example/android/app/build.gradle | 2 +- .../java/com/reactnct/MainApplication.java | 3 --- android/build.gradle | 6 ++--- android/src/main/AndroidManifest.xml | 12 ++++----- .../com/clevertap/react/CleverTapModule.java | 21 --------------- index.d.ts | 6 ++--- index.js | 17 ++++-------- package.json | 2 +- 10 files changed, 42 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1253c38..41d359f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,32 @@ 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.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). + * 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. + * 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". + + Version 2.1.0 *(7 March 2024)* ------------------------------------------- **What's new** 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') 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/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 7343e0cf..f813cf33 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,10 +1,8 @@ - + + - 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 0139202876e66344c4c6fed227a422af751fc7ae Mon Sep 17 00:00:00 2001 From: Anush-Shand <127097095+Anush-Shand@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:05:00 +0530 Subject: [PATCH 4/4] docs(SDK-3752) - Fixes typo (#389) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41d359f2..5c68c82d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,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 not found` for apps with `ReactNative` version _0.70 or lower_. * **[iOS Platform]** * Fixes a bug where client side in-apps were not discarded when rendering status is set to "discard".