clevertap-react-native 1.1.2 → 1.2.1
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/.vscode/settings.json +3 -0
- package/CHANGELOG.md +60 -0
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/clevertap/react/CleverTapModule.java +14 -0
- package/clevertap-react-native.podspec +1 -1
- package/docs/iospushtemplates.md +141 -8
- package/docs/usage.md +68 -1
- package/index.d.ts +6 -0
- package/index.js +9 -1
- package/ios/CleverTapReact/CleverTapReact.m +10 -0
- package/ios/CleverTapReact.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/CleverTapReact.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/CleverTapReact.xcodeproj/project.xcworkspace/xcuserdata/kushagra.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/CleverTapReact.xcodeproj/xcuserdata/kushagra.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/package.json +1 -1
- package/static/NotificationContentStoryboard.png +0 -0
- package/static/NotificationServiceTarget.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
==========
|
|
3
3
|
|
|
4
|
+
Version 1.2.1 *(25 October 2023)*
|
|
5
|
+
-------------------------------------------
|
|
6
|
+
**What's new**
|
|
7
|
+
* **[Android Platform]**
|
|
8
|
+
* Supports [CleverTap Android SDK v5.2.1](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-521-october-12-2023).
|
|
9
|
+
* 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.
|
|
10
|
+
|
|
11
|
+
* **[iOS Platform]**
|
|
12
|
+
* Supports [CleverTap iOS SDK v5.2.1](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/5.2.1).
|
|
13
|
+
* Adds support to enable `NSFileProtectionComplete` to secure App’s document directory.
|
|
14
|
+
|
|
15
|
+
* **[Android and iOS Platform]**
|
|
16
|
+
* Adds in-built support to send the default locale(i.e.language and country) data to the dashboard and exposed public API `CleverTapPlugin.setLocale(Locale locale)` to set the custom locale, for LP Parity.
|
|
17
|
+
* Adds support for Integration Debugger to view errors and events on the dashboard when the debugLevel is set to 3 using `CleverTapPlugin.setDebugLevel(3)`.
|
|
18
|
+
* Adds support to configure first tab title in App Inbox.
|
|
19
|
+
|
|
20
|
+
**Changes**
|
|
21
|
+
* **[iOS Platform]**
|
|
22
|
+
* Updated logic to retrieve country code using NSLocale above iOS 16 as `CTCarrier` is deprecated above iOS 16 with no replacements, see [Apple Doc](https://developer.apple.com/documentation/coretelephony/ctcarrier).
|
|
23
|
+
* Updated logic to not send carrier name above iOS 16 in CTCarrier field.
|
|
24
|
+
|
|
25
|
+
**Bug Fixes**
|
|
26
|
+
* **[iOS Platform]**
|
|
27
|
+
* Fixes a crash in iOS 17/Xcode 15 related to alert inapps.
|
|
28
|
+
|
|
29
|
+
Version 1.2.0 *(18th August 2023)*
|
|
30
|
+
-------------------------------------------
|
|
31
|
+
|
|
32
|
+
**What's new**
|
|
33
|
+
|
|
34
|
+
* **[Android Platform]**
|
|
35
|
+
* Supports [CleverTap Android SDK v5.2.0](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-520-august-10-2023).
|
|
36
|
+
* ***Note: RenderMax Push SDK functionality is now supported directly within the CleverTap Core SDK***. Please remove the [integrated RenderMax SDK](https://developer.clevertap.com/docs/react-native-push-notification#integrate-rendermax-push-sdk-with-react-native) before you upgrade to CleverTap React Native SDK for this version.
|
|
37
|
+
* Adds support for developer defined default notification channel. Please refer to the [Usage.md](https://github.com/CleverTap/clevertap-react-native/blob/master/docs/usage.md#default-notification-channel) file to read more on how to setup default channel in your app. Also please note that this is only supported for CleverTap core notifications. Support for push templates will be released soon.
|
|
38
|
+
|
|
39
|
+
* **[iOS Platform]**
|
|
40
|
+
* Supports [CleverTap iOS SDK v5.2.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/5.2.0).
|
|
41
|
+
|
|
42
|
+
* **[Android and iOS Platform]**
|
|
43
|
+
* Adds support for encryption of PII data wiz. Email, Identity, Name and Phone. Please refer to [Usage.md](https://github.com/CleverTap/clevertap-react-native/blob/master/docs/usage.md#encryption-of-pii-data) file to read more on how to enable/disable encryption of PII data.
|
|
44
|
+
* Adds support for custom KV pairs common to all inbox messages in App Inbox.
|
|
45
|
+
|
|
46
|
+
**API Changes**
|
|
47
|
+
* **[Android Platform]**
|
|
48
|
+
* Adds `SCCampaignOptOut` Event to Restricted Events Name List for **internal use**.
|
|
49
|
+
* Adds custom sdk versions to `af` field for **internal use**.
|
|
50
|
+
|
|
51
|
+
**Breaking API Changes**
|
|
52
|
+
* **[Android Platform]**
|
|
53
|
+
* **CTFlushPushImpressionsWork breaks custom WorkerFactory implementation of an App**:
|
|
54
|
+
* If you are using custom `WorkFactory` implementation of `WorkManager` for Android platform then make sure that you correctly handle workers defined by CleverTap SDK and other third party dependencies.
|
|
55
|
+
* You must return `null` from `createWorker()` for any unknown workerClassName. Please check implementation provided in the blog [here](https://medium.com/androiddevelopers/customizing-workmanager-fundamentals-fdaa17c46dd2).
|
|
56
|
+
|
|
57
|
+
**Bug Fixes**
|
|
58
|
+
* **[Android Platform]**
|
|
59
|
+
* Fixes [#393](https://github.com/CleverTap/clevertap-android-sdk/issues/393) - push permission flow crash when context in CoreMetadata is null.
|
|
60
|
+
* Fixes [#428](https://github.com/CleverTap/clevertap-android-sdk/issues/428) - Race-condition when detecting if an in-app message should show.
|
|
61
|
+
* Fixes Push primer alert dialog freeze behavior, which became unresponsive when clicked outside the window.
|
|
62
|
+
* Fixes a bug where addMultiValueForKey and addMultiValuesForKey were overwriting the current values of the user properties instead of appending it.
|
|
63
|
+
|
|
4
64
|
Version 1.1.2 *(31st July 2023)*
|
|
5
65
|
-------------------------------------------
|
|
6
66
|
**New Updates**
|
package/android/build.gradle
CHANGED
|
@@ -21,8 +21,8 @@ android {
|
|
|
21
21
|
defaultConfig {
|
|
22
22
|
minSdkVersion 19
|
|
23
23
|
targetSdkVersion 33
|
|
24
|
-
versionCode
|
|
25
|
-
versionName "1.
|
|
24
|
+
versionCode 121
|
|
25
|
+
versionName "1.2.1"
|
|
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:5.
|
|
42
|
+
api 'com.clevertap.android:clevertap-android-sdk:5.2.1'
|
|
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:+'
|
|
@@ -177,6 +177,16 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
177
177
|
cleverTap.setCustomSdkVersion(libName,libVersion);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
+
|
|
181
|
+
@ReactMethod
|
|
182
|
+
private void setLocale(String locale) {
|
|
183
|
+
CleverTapAPI cleverTap = getCleverTapAPI();
|
|
184
|
+
if (cleverTap != null) {
|
|
185
|
+
cleverTap.setLocale(locale);
|
|
186
|
+
} else {
|
|
187
|
+
Log.e(TAG, ErrorMessages.CLEVERTAP_NOT_INITIALIZED.getErrorMessage());
|
|
188
|
+
}
|
|
189
|
+
}
|
|
180
190
|
|
|
181
191
|
@ReactMethod
|
|
182
192
|
public void activate() {
|
|
@@ -1998,6 +2008,10 @@ public class CleverTapModule extends ReactContextBaseJavaModule implements SyncL
|
|
|
1998
2008
|
String noMessageTitleColor = styleConfig.getString(styleConfigKey);
|
|
1999
2009
|
ctInboxStyleConfig.setNoMessageViewTextColor(noMessageTitleColor);
|
|
2000
2010
|
}
|
|
2011
|
+
if ("firstTabTitle".equals(styleConfigKey) && readableType == ReadableType.String) {
|
|
2012
|
+
String firstTabTitle = styleConfig.getString(styleConfigKey);
|
|
2013
|
+
ctInboxStyleConfig.setFirstTabTitle(firstTabTitle);
|
|
2014
|
+
}
|
|
2001
2015
|
|
|
2002
2016
|
} catch (Throwable t) {
|
|
2003
2017
|
Log.e(TAG, t.getLocalizedMessage());
|
|
@@ -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', '5.1
|
|
21
|
+
s.dependency 'CleverTap-iOS-SDK', '5.2.1'
|
|
22
22
|
s.dependency 'React-Core'
|
|
23
23
|
end
|
package/docs/iospushtemplates.md
CHANGED
|
@@ -4,34 +4,151 @@ CleverTap Push Templates SDK helps you engage with your users using fancy push n
|
|
|
4
4
|
|
|
5
5
|
# Table of contents
|
|
6
6
|
|
|
7
|
-
- [
|
|
7
|
+
- [Notification Service](#notification-service)
|
|
8
|
+
- [Notification Content](#notification-content)
|
|
8
9
|
- [Dashboard Usage](#dashboard-usage)
|
|
9
10
|
- [Template Types](#template-types)
|
|
10
11
|
- [Template Keys](#template-keys)
|
|
11
12
|
|
|
12
|
-
#
|
|
13
|
+
# Notification Service
|
|
13
14
|
|
|
14
15
|
[(Back to top)](#table-of-contents)
|
|
15
|
-
|
|
16
|
+
## Installation
|
|
17
|
+
- Go to File -> New -> Target -> Notification Service Extension and select Objective-C language
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
- Update Podfile as below and do `pod install`, refer [example](https://github.com/CleverTap/clevertap-react-native/blob/master/Example/ios/Podfile) for detailed Podfile.
|
|
21
|
+
```
|
|
22
|
+
target 'NotificationService' do
|
|
23
|
+
pod "CTNotificationService", :modular_headers => true
|
|
24
|
+
end
|
|
25
|
+
```
|
|
26
|
+
- Update your `NotificationService.h` as:
|
|
27
|
+
```
|
|
28
|
+
#import <CTNotificationService/CTNotificationService.h>
|
|
29
|
+
|
|
30
|
+
@interface NotificationService : CTNotificationServiceExtension
|
|
31
|
+
@end
|
|
32
|
+
```
|
|
33
|
+
- Update your `NotificationService.m` file as:
|
|
34
|
+
```
|
|
35
|
+
#import "NotificationService.h"
|
|
36
|
+
|
|
37
|
+
@implementation NotificationService
|
|
38
|
+
|
|
39
|
+
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
|
|
40
|
+
[super didReceiveNotificationRequest:request withContentHandler:contentHandler];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@end
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Push Impression
|
|
47
|
+
- Add `pod "CleverTap-iOS-SDK" ` in podfile for notification service target as do `pod install`:
|
|
48
|
+
```
|
|
49
|
+
target 'NotificationService' do
|
|
50
|
+
pod "CleverTap-iOS-SDK", :modular_headers => true
|
|
51
|
+
pod "CTNotificationService", :modular_headers => true
|
|
52
|
+
end
|
|
53
|
+
```
|
|
54
|
+
- Add CleverTap Account Id and Token in target `Info.plist` file as updated [here](https://github.com/CleverTap/clevertap-react-native/tree/master/Example/ios/Example/NotificationService/Info.plist)
|
|
55
|
+
- Update your `NotificationService.m` file as:
|
|
56
|
+
```
|
|
57
|
+
#import "NotificationService.h"
|
|
58
|
+
#import <CleverTap-iOS-SDK/CleverTap.h>
|
|
59
|
+
|
|
60
|
+
@implementation NotificationService
|
|
61
|
+
|
|
62
|
+
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
|
|
63
|
+
// Add CleverTap Account ID and Account token in your target .plist file
|
|
64
|
+
[CleverTap setDebugLevel:2];
|
|
65
|
+
NSDictionary *profile = @{
|
|
66
|
+
@"Name": @"testUserA1",
|
|
67
|
+
@"Identity": @123456,
|
|
68
|
+
@"Email": @"test@test.com"
|
|
69
|
+
};
|
|
70
|
+
[[CleverTap sharedInstance] profilePush:profile];
|
|
71
|
+
[[CleverTap sharedInstance] recordNotificationViewedEventWithData: request.content.userInfo];
|
|
72
|
+
|
|
73
|
+
[super didReceiveNotificationRequest:request withContentHandler:contentHandler];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@end
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- Refer [example](https://github.com/CleverTap/clevertap-react-native/tree/master/Example/ios/Example/NotificationService) for more details if you are using Objective-C language for the target.
|
|
80
|
+
|
|
81
|
+
## Add Notification Service target using Swift language
|
|
82
|
+
- Go to File -> New -> Target -> Notification Service Extension and select Swift language
|
|
83
|
+
- Update Podfile as below and `pod install`:
|
|
84
|
+
```
|
|
85
|
+
target 'NotificationService' do
|
|
86
|
+
pod "CTNotificationService", :modular_headers => true
|
|
87
|
+
end
|
|
88
|
+
```
|
|
89
|
+
- Update your `NotificationService.swift` as
|
|
90
|
+
```
|
|
91
|
+
import CTNotificationService
|
|
92
|
+
|
|
93
|
+
class NotificationService: CTNotificationServiceExtension {
|
|
94
|
+
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
|
95
|
+
super.didReceive(request, withContentHandler: contentHandler)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Push Impression using Swift language target
|
|
101
|
+
- Add `pod "CleverTap-iOS-SDK" ` in podfile for notification service target and do `pod install` as
|
|
102
|
+
```
|
|
103
|
+
target 'NotificationService' do
|
|
104
|
+
pod "CleverTap-iOS-SDK", :modular_headers => true
|
|
105
|
+
pod "CTNotificationService", :modular_headers => true
|
|
106
|
+
end
|
|
107
|
+
```
|
|
108
|
+
- Add CleverTap Account Id and Token in target `Info.plist` file as updated [here](https://github.com/CleverTap/clevertap-react-native/tree/master/Example/ios/Example/NotificationService/Info.plist)
|
|
109
|
+
- Update your `NotificationService.swift` file as:
|
|
110
|
+
```
|
|
111
|
+
import CTNotificationService
|
|
112
|
+
import CleverTapSDK
|
|
113
|
+
|
|
114
|
+
class NotificationService: CTNotificationServiceExtension {
|
|
115
|
+
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
|
|
116
|
+
let profile: Dictionary<String, AnyObject> = [
|
|
117
|
+
"Name": "testUserA1" as AnyObject,
|
|
118
|
+
"Identity": 123456 as AnyObject,
|
|
119
|
+
"Email": "test@test.com" as AnyObject ]
|
|
120
|
+
CleverTap.sharedInstance()?.profilePush(profile)
|
|
121
|
+
CleverTap.sharedInstance()?.recordNotificationViewedEvent(withData: request.content.userInfo)
|
|
122
|
+
super.didReceive(request, withContentHandler: contentHandler)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
# Notification Content
|
|
128
|
+
|
|
129
|
+
[(Back to top)](#table-of-contents)
|
|
130
|
+
|
|
131
|
+
Add Notification Content Extension (Push Templates) in a React Native iOS Project
|
|
16
132
|
Notification Content Extension is an app extension that provides a custom interface when a user previews your notification in the notification center. To enable the functionality of CleverTap iOS Push templates, we need this extension in the project which act as subclass to our CTNotificationContent framework.
|
|
17
133
|
|
|
18
|
-
|
|
134
|
+
## Installation
|
|
135
|
+
- Open Example.xcodeproj (or your app’s .xcodeproj file) in the ios folder of React Native project.
|
|
136
|
+
- Go to File > New > Target… and search with the name “Notification Content Extension“
|
|
19
137
|
|
|
20
138
|

|
|
21
139
|
|
|
22
|
-
Add “Notification Content“ as target name.
|
|
140
|
+
- Add “Notification Content“ as target name.
|
|
23
141
|
|
|
24
142
|

|
|
25
143
|
|
|
26
|
-
Refer to https://github.com/CleverTap/CTNotificationContent#-setup for setting up Notification Content target so that it imports CTNotificationContent framework in the code. Make sure to add the necessary key-values in the Info.plist file of NotificationContent target so that it recognises the identifier of the incoming notification.
|
|
144
|
+
- Refer to https://github.com/CleverTap/CTNotificationContent#-setup for setting up Notification Content target so that it imports CTNotificationContent framework in the code. Make sure to add the necessary key-values in the Info.plist file of NotificationContent target so that it recognises the identifier of the incoming notification.
|
|
27
145
|
|
|
28
146
|
Alternatively, go to finder and replace newly created NotificationContent (or your content extension) folder with the NotificationContent folder in CTNotificationContent Example project repository.
|
|
29
147
|
|
|
30
148
|

|
|
31
149
|
|
|
32
|
-
Add the following to a file named Podfile in the ios directory of your project.
|
|
150
|
+
- Add the following to a file named Podfile in the ios directory of your project.
|
|
33
151
|
```
|
|
34
|
-
use_frameworks!
|
|
35
152
|
target 'NotificationContent' do
|
|
36
153
|
pod 'CTNotificationContent'
|
|
37
154
|
end
|
|
@@ -139,6 +256,22 @@ target 'reactnativedemo' do
|
|
|
139
256
|
end
|
|
140
257
|
```
|
|
141
258
|
|
|
259
|
+
- Edit the Maininterface.storyboard in your NotificationContent target to a plain UIView. Steps:
|
|
260
|
+
MainInterface.storyboard -> Expand View -> Click Label -> Delete
|
|
261
|
+
|
|
262
|
+

|
|
263
|
+
|
|
264
|
+
- Update NotificationViewController.h, NotificationViewController.m and Info.plist as updated in [example app](https://github.com/CleverTap/clevertap-react-native/tree/master/Example/ios/Example/NotificationContent)
|
|
265
|
+
- Set Notification categories from AppDelegate if you want to add category buttons in `didFinishLaunchingWithOptions:` method and add import `#import <UserNotifications/UserNotifications.h>`:
|
|
266
|
+
```
|
|
267
|
+
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
|
268
|
+
UNNotificationAction *action1 = [UNNotificationAction actionWithIdentifier:@"action_1" title:@"Back" options:UNNotificationActionOptionNone];
|
|
269
|
+
UNNotificationAction *action2 = [UNNotificationAction actionWithIdentifier:@"action_2" title:@"Next" options:UNNotificationActionOptionNone];
|
|
270
|
+
UNNotificationAction *action3 = [UNNotificationAction actionWithIdentifier:@"action_3" title:@"View In App" options:UNNotificationActionOptionNone];
|
|
271
|
+
UNNotificationCategory *cat = [UNNotificationCategory categoryWithIdentifier:@"CTNotification" actions:@[action1, action2, action3] intentIdentifiers:@[] options:UNNotificationCategoryOptionNone];
|
|
272
|
+
[center setNotificationCategories:[NSSet setWithObjects:cat, nil]];
|
|
273
|
+
```
|
|
274
|
+
|
|
142
275
|
### Out of the box
|
|
143
276
|
|
|
144
277
|
|
package/docs/usage.md
CHANGED
|
@@ -66,6 +66,41 @@ CleverTap.profileDecrementValueForKey(1, "score");
|
|
|
66
66
|
|
|
67
67
|
-----------
|
|
68
68
|
|
|
69
|
+
## Integrate Custom Proxy Domain
|
|
70
|
+
The custom proxy domain feature allows to proxy all events raised from the CleverTap SDK through your required domain,
|
|
71
|
+
ideal for handling or relaying CleverTap events and Push Impression events with your application server.
|
|
72
|
+
Refer following steps to configure the custom proxy domain(s) in the manifest file:
|
|
73
|
+
|
|
74
|
+
#### [Android Platform] Configure Custom Proxy Domain(s) using Manifest file
|
|
75
|
+
1. Add your CleverTap Account credentials in the Manifest file against the `CLEVERTAP_ACCOUNT_ID` and `CLEVERTAP_TOKEN` keys.
|
|
76
|
+
2. Add the **CLEVERTAP_PROXY_DOMAIN** key with the proxy domain value for handling events through the custom proxy domain.
|
|
77
|
+
3. Add the **CLEVERTAP_SPIKY_PROXY_DOMAIN** key with proxy domain value for handling push impression events.
|
|
78
|
+
|
|
79
|
+
```xml
|
|
80
|
+
<meta-data
|
|
81
|
+
android:name="CLEVERTAP_ACCOUNT_ID"
|
|
82
|
+
android:value="YOUR ACCOUNT ID" />
|
|
83
|
+
<meta-data
|
|
84
|
+
android:name="CLEVERTAP_TOKEN"
|
|
85
|
+
android:value="YOUR ACCOUNT TOKEN" />
|
|
86
|
+
<meta-data
|
|
87
|
+
android:name="CLEVERTAP_PROXY_DOMAIN"
|
|
88
|
+
android:value="YOUR PROXY DOMAIN"/> <!-- e.g., analytics.sdktesting.xyz -->
|
|
89
|
+
<meta-data
|
|
90
|
+
android:name="CLEVERTAP_SPIKY_PROXY_DOMAIN"
|
|
91
|
+
android:value="YOUR SPIKY PROXY DOMAIN"/> <!-- e.g., spiky-analytics.sdktesting.xyz -->
|
|
92
|
+
```
|
|
93
|
+
#### [iOS Platform] Configure Custom Proxy Domain(s) using `CleverTap.autoIntegrate()` API
|
|
94
|
+
1. Add your CleverTap Account credentials in the *Info.plist* file against the `CleverTapAccountID` and `CleverTapToken` keys.
|
|
95
|
+
2. Add the `CleverTapProxyDomain` key with the proxy domain value for handling events through the custom proxy domain e.g., *analytics.sdktesting.xyz*.
|
|
96
|
+
3. Add the `CleverTapSpikyProxyDomain` key with proxy domain value for handling push impression events e.g., *spiky-analytics.sdktesting.xyz*.
|
|
97
|
+
4. Import the CleverTap SDK in your *AppDelegate* file and call the following method in the `didFinishLaunchingWithOptions:` method.
|
|
98
|
+
``` swift
|
|
99
|
+
CleverTap.autoIntegrate()
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
-----------
|
|
103
|
+
|
|
69
104
|
## User Events
|
|
70
105
|
|
|
71
106
|
#### Record an event
|
|
@@ -88,6 +123,25 @@ CleverTap.recordChargedEvent({'totalValue': 20, 'category': 'books'}, [{'title':
|
|
|
88
123
|
|
|
89
124
|
-----------
|
|
90
125
|
|
|
126
|
+
## Encryption of PII data
|
|
127
|
+
PII data is stored across the SDK and could be sensitive information. From CleverTap SDK v5.2.0 onwards, you can enable encryption for PII data wiz. Email, Identity, Name and Phone.
|
|
128
|
+
|
|
129
|
+
Currently 2 levels of encryption are supported i.e None(0) and Medium(1). Encryption level is None by default.
|
|
130
|
+
**None** - All stored data is in plaintext
|
|
131
|
+
**Medium** - PII data is encrypted completely.
|
|
132
|
+
|
|
133
|
+
#### Android
|
|
134
|
+
Add encryption level in the `AndroidManifest.xml` as following:
|
|
135
|
+
```XML
|
|
136
|
+
<meta-data
|
|
137
|
+
android:name="CLEVERTAP_ENCRYPTION_LEVEL"
|
|
138
|
+
android:value="1" />
|
|
139
|
+
```
|
|
140
|
+
#### iOS
|
|
141
|
+
Add the `CleverTapEncryptionLevel` String key to `info.plist` file where value 1 means Medium and 0 means None. Encryption Level will be None if any other value is provided.
|
|
142
|
+
|
|
143
|
+
-----------
|
|
144
|
+
|
|
91
145
|
## App Inbox
|
|
92
146
|
|
|
93
147
|
#### Initialize the CleverTap App Inbox Method
|
|
@@ -101,7 +155,7 @@ CleverTap.initializeInbox();
|
|
|
101
155
|
```javascript
|
|
102
156
|
CleverTap.showInbox({'tabs':['Offers','Promotions'],'navBarTitle':'My App Inbox','navBarTitleColor':'#FF0000','navBarColor':'#FFFFFF','inboxBackgroundColor':'#AED6F1','backButtonColor':'#00FF00'
|
|
103
157
|
,'unselectedTabColor':'#0000FF','selectedTabColor':'#FF0000','selectedTabIndicatorColor':'#000000',
|
|
104
|
-
'noMessageText':'No message(s)','noMessageTextColor':'#FF0000'});
|
|
158
|
+
'noMessageText':'No message(s)','noMessageTextColor':'#FF0000','firstTabTitle':'First Tab' });
|
|
105
159
|
```
|
|
106
160
|
|
|
107
161
|
#### App Inbox Item Click Callback
|
|
@@ -213,6 +267,19 @@ Follow the [Push Primer integration doc](pushprimer.md).
|
|
|
213
267
|
CleverTap.createNotificationChannel("CtRNS", "Clever Tap React Native Testing", "CT React Native Testing", 1, true);
|
|
214
268
|
```
|
|
215
269
|
|
|
270
|
+
#### Default Notification Channel
|
|
271
|
+
Starting from CleverTap React Native SDK v1.2.0, we have introduced a new feature that allows developers to define a default notification channel for their app. This feature provides flexibility in handling push notifications. Please note that this is only supported for clevertap core notifications. Support for push templates will be released soon. To specify the default notification channel ID, you can add the following metadata in your app's manifest file:
|
|
272
|
+
|
|
273
|
+
```XML
|
|
274
|
+
<meta-data android:name="CLEVERTAP_DEFAULT_CHANNEL_ID" android:value="your_default_channel_id" />
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
By including this metadata, you can define a specific notification channel that CleverTap will use if the channel provided in push payload is not registered by your app. This ensures that push notifications are displayed consistently even if the app's notification channels are not set up.
|
|
278
|
+
|
|
279
|
+
In case the SDK does not find the default channel ID specified in the manifest, it will automatically fallback to using a default channel called "Miscellaneous". This ensures that push notifications are still delivered, even if no specific default channel is specified in the manifest.
|
|
280
|
+
|
|
281
|
+
This enhancement provides developers with greater control over the default notification channel used by CleverTap for push notifications, ensuring a seamless and customizable user experience.
|
|
282
|
+
|
|
216
283
|
#### Delete Notification Channel
|
|
217
284
|
|
|
218
285
|
```javascript
|
package/index.d.ts
CHANGED
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
*/
|
|
33
33
|
export function getInitialUrl(callback: Callback): void;
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Call this method to set Locale. If Language is english and country is US the locale format which you can set is en_US
|
|
37
|
+
* @param locale {string}
|
|
38
|
+
*/
|
|
39
|
+
export function setLocale(locale: string): void;
|
|
40
|
+
|
|
35
41
|
/*******************
|
|
36
42
|
* Personalization
|
|
37
43
|
******************/
|
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const EventEmitter = NativeModules.CleverTapReactEventEmitter ? new NativeEventE
|
|
|
9
9
|
* @param {int} libVersion - The updated library version. If current version is 1.1.0 then pass as 10100
|
|
10
10
|
*/
|
|
11
11
|
const libName = 'React-Native';
|
|
12
|
-
const libVersion =
|
|
12
|
+
const libVersion = 10201;
|
|
13
13
|
CleverTapReact.setLibrary(libName,libVersion);
|
|
14
14
|
|
|
15
15
|
function defaultCallback(method, err, res) {
|
|
@@ -109,6 +109,14 @@ var CleverTap = {
|
|
|
109
109
|
callWithCallback('getInitialUrl', null, callback);
|
|
110
110
|
},
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Call this method to set Locale. If Language is english and country is US the locale format which you can set is en_US
|
|
114
|
+
* @param {string} locale - the locale string
|
|
115
|
+
*/
|
|
116
|
+
setLocale: function (locale) {
|
|
117
|
+
CleverTapReact.setLocale(locale);
|
|
118
|
+
},
|
|
119
|
+
|
|
112
120
|
/**
|
|
113
121
|
* Registers the application to receive push notifications
|
|
114
122
|
* only necessary for iOS.
|
|
@@ -119,6 +119,12 @@ RCT_EXPORT_METHOD(setLibrary:(NSString*)name andVersion:(int)version) {
|
|
|
119
119
|
[[self cleverTapInstance] setCustomSdkVersion:name version:version];
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
RCT_EXPORT_METHOD(setLocale:(NSString*)locale) {
|
|
123
|
+
RCTLogInfo(@"[CleverTap setLocale:%@]", locale);
|
|
124
|
+
NSLocale *userLocale = [NSLocale localeWithLocaleIdentifier:locale];
|
|
125
|
+
[[self cleverTapInstance] setLocale:userLocale];
|
|
126
|
+
}
|
|
127
|
+
|
|
122
128
|
#pragma mark - Push Notifications
|
|
123
129
|
|
|
124
130
|
RCT_EXPORT_METHOD(registerForPush) {
|
|
@@ -683,6 +689,10 @@ RCT_EXPORT_METHOD(showInbox:(NSDictionary*)styleConfig) {
|
|
|
683
689
|
if (noMessageText) {
|
|
684
690
|
_config.noMessageViewText = noMessageText;
|
|
685
691
|
}
|
|
692
|
+
NSString *firstTabTitle = [dict valueForKey:@"firstTabTitle"];
|
|
693
|
+
if (firstTabTitle) {
|
|
694
|
+
_config.firstTabTitle = firstTabTitle;
|
|
695
|
+
}
|
|
686
696
|
return _config;
|
|
687
697
|
}
|
|
688
698
|
- (UIColor *)ct_colorWithHexString:(NSString *)string alpha:(CGFloat)alpha{
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>CleverTapReact.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|