clevertap-react-native 3.5.0 → 3.7.0

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,38 @@
1
1
  Change Log
2
2
  ==========
3
3
 
4
+ Version 3.7.0 *(October 3 2025)*
5
+ -------------------------------------------
6
+ **What's new**
7
+ * **[Android Platform]**
8
+ * Supports [CleverTap Android SDK v7.5.2](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-752-september-11-2025).
9
+
10
+ * **[iOS Platform]**
11
+ * Supports [CleverTap iOS SDK v7.3.3](https://github.com/CleverTap/clevertap-ios-sdk/blob/master/CHANGELOG.md#version-733-september-11-2025).
12
+
13
+ **Bug Fixes**
14
+ * **[Android and iOS Platform]**
15
+ * Fixes [#480](https://github.com/CleverTap/clevertap-react-native/issues/480) – an issue where dates were incorrectly parsed for the case-sensitive `DOB` key.
16
+
17
+ Version 3.6.0 *(July 17 2025)*
18
+ -------------------------------------------
19
+ **What's new**
20
+ * **[Android Platform]**
21
+ * Supports [CleverTap Android SDK v7.5.0](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-750-july-11-2025).
22
+
23
+ * **[iOS Platform]**
24
+ * Supports [CleverTap iOS SDK v7.3.1](https://github.com/CleverTap/clevertap-ios-sdk/blob/master/CHANGELOG.md#version-731-july-15-2025).
25
+
26
+ **API changes**
27
+ * **[Android and iOS Platform]**
28
+ * Updates the `setOptOut(userOptOut)` API. This upgraded API improves GDPR opt-out functionality by allowing you to control whether critical system events (such as app installs, uninstalls, and push notification registration) are still sent to CleverTap, even when a user has opted out of tracking. This helps you respect user privacy choices while still maintaining essential app functionality and compliance with regulations. This is non-breaking change.
29
+ * `setOptOut(userOptOut, allowSystemEvents)`
30
+
31
+ **Bug Fixes**
32
+ * **[iOS Platform]**
33
+ * Fixes a `No new templates are synced` error while syncing new custom templates.
34
+ * Fixes a Local Push Primer crash when asking for push permission using promptForPushPermission.
35
+
4
36
  Version 3.5.0 *(June 27 2025)*
5
37
  -------------------------------------------
6
38
  **What's new**
@@ -235,7 +267,7 @@ Version 1.2.1 *(25 October 2023)*
235
267
  **What's new**
236
268
  * **[Android Platform]**
237
269
  * Supports [CleverTap Android SDK v5.2.1](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-521-october-12-2023).
238
- * Adds Custom Proxy Domain functionality for Push Impressions and Events raised from CleverTap Android SDK. Please refer to [Usage.md](docs/Usage.md#integrate-custom-proxy-domain) file to read more on how to configure custom proxy domains in Android.
270
+ * Adds Custom Proxy Domain functionality for Push Impressions and Events raised from CleverTap Android SDK. Please refer to [Usage.md](docs/usage.md#integrate-custom-proxy-domain) file to read more on how to configure custom proxy domains in Android.
239
271
 
240
272
  * **[iOS Platform]**
241
273
  * Supports [CleverTap iOS SDK v5.2.1](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/5.2.1).
File without changes
@@ -0,0 +1,2 @@
1
+ #Mon Jul 14 15:16:11 IST 2025
2
+ gradle.version=8.5
@@ -0,0 +1,2 @@
1
+ #Mon Sep 02 11:39:00 IST 2024
2
+ java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
File without changes
@@ -0,0 +1,13 @@
1
+ arguments=--init-script /var/folders/tb/xy65j0js76dbd8tvp5tcww700000gp/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/tb/xy65j0js76dbd8tvp5tcww700000gp/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
2
+ auto.sync=false
3
+ build.scans.enabled=false
4
+ connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5
+ connection.project.dir=
6
+ eclipse.preferences.version=1
7
+ gradle.user.home=
8
+ java.home=/Users/anush/Library/Java/JavaVirtualMachines/jbr-17.0.14/Contents/Home
9
+ jvm.arguments=
10
+ offline.mode=false
11
+ override.workspace.settings=true
12
+ show.console.view=true
13
+ show.executions.view=true
@@ -35,8 +35,8 @@ android {
35
35
  defaultConfig {
36
36
  minSdkVersion 21
37
37
  targetSdkVersion 35
38
- versionCode 350
39
- versionName "3.5.0"
38
+ versionCode 370
39
+ versionName "3.7.0"
40
40
  buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
41
41
  }
42
42
 
@@ -54,7 +54,7 @@ android {
54
54
  }
55
55
 
56
56
  dependencies {
57
- api 'com.clevertap.android:clevertap-android-sdk:7.4.1'
57
+ api 'com.clevertap.android:clevertap-android-sdk:7.5.2'
58
58
  implementation 'com.android.installreferrer:installreferrer:2.2'
59
59
  //compile 'com.android.support:appcompat-v7:28.0.0'
60
60
  implementation 'com.facebook.react:react-native:+'
@@ -0,0 +1,8 @@
1
+ ## This file must *NOT* be checked into Version Control Systems,
2
+ # as it contains information specific to your local configuration.
3
+ #
4
+ # Location of the SDK. This is only used by Gradle.
5
+ # For customization when using a Version Control System, please read the
6
+ # header note.
7
+ #Tue Mar 05 15:18:18 IST 2024
8
+ sdk.dir=/Users/anush/Library/Android/sdk
@@ -1073,12 +1073,17 @@ public class CleverTapModuleImpl {
1073
1073
  clevertap.setOffline(value);
1074
1074
  }
1075
1075
 
1076
- public void setOptOut(boolean value) {
1076
+ public void setOptOut(boolean userOptOut, Boolean allowSystemEvents) {
1077
1077
  CleverTapAPI clevertap = getCleverTapAPI();
1078
1078
  if (clevertap == null) {
1079
1079
  return;
1080
1080
  }
1081
- clevertap.setOptOut(value);
1081
+
1082
+ if (allowSystemEvents != null) {
1083
+ clevertap.setOptOut(userOptOut, allowSystemEvents);
1084
+ } else {
1085
+ clevertap.setOptOut(userOptOut);
1086
+ }
1082
1087
  }
1083
1088
 
1084
1089
  public void pushRegistrationToken(String token, ReadableMap type) {
@@ -1662,7 +1667,7 @@ public class CleverTapModuleImpl {
1662
1667
  String key = iterator.nextKey();
1663
1668
  ReadableType readableType = profileMap.getType(key);
1664
1669
 
1665
- if ("DOB".equals(key) && (readableType == ReadableType.String)) {
1670
+ if ("DOB".equals(key) && (readableType == ReadableType.String) && !profileMap.getString(key).startsWith("$D_")) {
1666
1671
  String dob = profileMap.getString(key);
1667
1672
  SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH);
1668
1673
  try {
@@ -400,8 +400,8 @@ class CleverTapModule(reactContext: ReactApplicationContext?) :
400
400
  cleverTapModuleImpl.setOffline(value)
401
401
  }
402
402
 
403
- override fun setOptOut(value: Boolean) {
404
- cleverTapModuleImpl.setOptOut(value)
403
+ override fun setOptOut(userOptOut: Boolean, allowSystemEvents: Boolean?) {
404
+ cleverTapModuleImpl.setOptOut(userOptOut, allowSystemEvents)
405
405
  }
406
406
 
407
407
  override fun pushRegistrationToken(token: String?, pushType: ReadableMap?) {
@@ -472,8 +472,8 @@ class CleverTapModule(reactContext: ReactApplicationContext?) :
472
472
  }
473
473
 
474
474
  @ReactMethod
475
- fun setOptOut(value: Boolean) {
476
- cleverTapModuleImpl.setOptOut(value)
475
+ fun setOptOut(userOptOut: Boolean, allowSystemEvents: Boolean?) {
476
+ cleverTapModuleImpl.setOptOut(userOptOut, allowSystemEvents)
477
477
  }
478
478
 
479
479
  @ReactMethod
@@ -24,7 +24,7 @@ Pod::Spec.new do |s|
24
24
  s.dependency 'React-Core'
25
25
  end
26
26
 
27
- s.dependency 'CleverTap-iOS-SDK', '7.2.1'
27
+ s.dependency 'CleverTap-iOS-SDK', '7.3.3'
28
28
 
29
29
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
30
30
  s.pod_target_xcconfig = {
package/docs/usage.md CHANGED
@@ -12,6 +12,7 @@ const CleverTap = require('clevertap-react-native');
12
12
 
13
13
  ```javascript
14
14
  CleverTap.profileSet({"Identity":11102008, "Name":"React-Test Profile","Email":"r@gmail.com","Gender":"Male","DOB":"1995-10-14", "custom":1.73});
15
+ // The 'DOB' case-sensitive key can have the value either as a Date object or a string in the format 'yyyy-mm-dd'
15
16
  ```
16
17
 
17
18
  #### Set Multi Values For Key
@@ -206,9 +206,13 @@ RCT_EXPORT_METHOD(setOffline:(BOOL)enabled) {
206
206
 
207
207
  #pragma mark - OptOut API
208
208
 
209
- RCT_EXPORT_METHOD(setOptOut:(BOOL)enabled) {
210
- RCTLogInfo(@"[CleverTap setOptOut: %i]", enabled);
211
- [[self cleverTapInstance] setOptOut:enabled];
209
+ RCT_EXPORT_METHOD(setOptOut:(BOOL)userOptOut allowSystemEvents:(NSNumber *)allowSystemEvents) {
210
+ RCTLogInfo(@"[CleverTap setOptOut and allowSystemEvents: %i, %@]", userOptOut, allowSystemEvents);
211
+ if (allowSystemEvents != nil) {
212
+ [[self cleverTapInstance] setOptOut:userOptOut allowSystemEvents:[allowSystemEvents boolValue]];
213
+ } else {
214
+ [[self cleverTapInstance] setOptOut:userOptOut];
215
+ }
212
216
  }
213
217
 
214
218
  RCT_EXPORT_METHOD(enableDeviceNetworkInfoReporting:(BOOL)enabled) {
@@ -565,8 +569,7 @@ RCT_EXPORT_METHOD(setDebugLevel:(double)level) {
565
569
 
566
570
  NSDate *dob = nil;
567
571
 
568
- if([value isKindOfClass:[NSString class]]) {
569
-
572
+ if([value isKindOfClass:[NSString class]] && ![value hasPrefix:@"$D_"]) {
570
573
  if(!dateFormatter) {
571
574
  dateFormatter = [[NSDateFormatter alloc] init];
572
575
  [dateFormatter setDateFormat:@"yyyy-MM-dd"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clevertap-react-native",
3
- "version": "3.5.0",
3
+ "version": "3.7.0",
4
4
  "description": "CleverTap React Native SDK.",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -42,7 +42,7 @@ export interface Spec extends TurboModule {
42
42
  enablePersonalization(): void;
43
43
  disablePersonalization(): void;
44
44
  setOffline(enabled: boolean): void;
45
- setOptOut(enabled: boolean): void;
45
+ setOptOut(userOptOut: boolean, allowSystemEvents?: boolean): void;
46
46
  enableDeviceNetworkInfoReporting(enabled: boolean): void;
47
47
  recordScreenView(screenName: string): void;
48
48
  recordEvent(
package/src/index.d.ts CHANGED
@@ -48,10 +48,36 @@
48
48
  export function enablePersonalization(): void;
49
49
 
50
50
  /**
51
- * Enables tracking opt out for the currently active user.
52
- * @param optOut {boolean}
51
+ * Sets the user's consent for event and profile tracking.
52
+ *
53
+ * You must call this method separately for each active user profile,
54
+ * for example, when switching user profiles using `onUserLogin`.
55
+ *
56
+ * Consent Scenarios:
57
+ *
58
+ * 1. **Complete Opt-Out**
59
+ * `userOptOut = true`, `allowSystemEvents = false`
60
+ * → No events (custom or system) are saved locally or remotely. Maximum privacy.
61
+ *
62
+ * 2. **Full Opt-In**
63
+ * `userOptOut = false`, `allowSystemEvents = true`
64
+ * → All events (custom and system) are tracked. Default behavior.
65
+ *
66
+ * 3. **Partial Opt-In**
67
+ * `userOptOut = true`, `allowSystemEvents = true`
68
+ * → Only system events (e.g., app launch, notification viewed) are tracked. Custom events are ignored.
69
+ *
70
+ * ⚠️ The combination `userOptOut = false` and `allowSystemEvents = false` is invalid.
71
+ * In such cases, the SDK defaults to **Full Opt-In**.
72
+ *
73
+ * To re-enable full tracking after opting out, call with:
74
+ * `userOptOut = false`, `allowSystemEvents = true`.
75
+ *
76
+ * @param {boolean} userOptOut - Set to `true` to disable custom event tracking.
77
+ * @param {boolean} allowSystemEvents - Set to `true` to allow system-level event tracking.
78
+ * @returns {void}
53
79
  */
54
- export function setOptOut(optOut: boolean): void;
80
+ export function setOptOut(userOptOut: boolean, allowSystemEvents?: boolean): void;
55
81
 
56
82
  /**
57
83
  * Enables the reporting of device network related information, including IP address. This reporting is disabled by default.
package/src/index.js CHANGED
@@ -12,7 +12,7 @@ const EventEmitter = Platform.select({
12
12
  * @param {int} libVersion - The updated library version. If current version is 1.1.0 then pass as 10100
13
13
  */
14
14
  const libName = 'React-Native';
15
- const libVersion = 30500;
15
+ const libVersion = 30700;
16
16
  CleverTapReact.setLibrary(libName,libVersion);
17
17
 
18
18
  function defaultCallback(method, err, res) {
@@ -272,11 +272,37 @@ var CleverTap = {
272
272
  },
273
273
 
274
274
  /**
275
- * Enables tracking opt out for the currently active user.
276
- * @param {boolean} value - A boolean for enabling or disabling tracking for current user
277
- */
278
- setOptOut: function (value) {
279
- CleverTapReact.setOptOut(value);
275
+ * Sets the user's consent for event and profile tracking.
276
+ *
277
+ * You must call this method separately for each active user profile,
278
+ * for example, when switching user profiles using `onUserLogin`.
279
+ *
280
+ * Consent Scenarios:
281
+ *
282
+ * 1. **Complete Opt-Out**
283
+ * `userOptOut = true`, `allowSystemEvents = false`
284
+ * → No events (custom or system) are saved locally or remotely. Maximum privacy.
285
+ *
286
+ * 2. **Full Opt-In**
287
+ * `userOptOut = false`, `allowSystemEvents = true`
288
+ * → All events (custom and system) are tracked. Default behavior.
289
+ *
290
+ * 3. **Partial Opt-In**
291
+ * `userOptOut = true`, `allowSystemEvents = true`
292
+ * → Only system events (e.g., app launch, notification viewed) are tracked. Custom events are ignored.
293
+ *
294
+ * ⚠️ The combination `userOptOut = false` and `allowSystemEvents = false` is invalid.
295
+ * In such cases, the SDK defaults to **Full Opt-In**.
296
+ *
297
+ * To re-enable full tracking after opting out, call with:
298
+ * `userOptOut = false`, `allowSystemEvents = true`.
299
+ *
300
+ * @param {boolean} userOptOut - Set to `true` to disable custom event tracking.
301
+ * @param {boolean} allowSystemEvents - Set to `true` to allow system-level event tracking.
302
+ * @returns {void}
303
+ */
304
+ setOptOut: function(userOptOut, allowSystemEvents) {
305
+ CleverTapReact.setOptOut(userOptOut, allowSystemEvents);
280
306
  },
281
307
 
282
308
  /**