clevertap-react-native 0.5.0 → 0.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/.codebeatignore +1 -1
- package/CHANGELOG.md +28 -0
- package/LICENSE +2 -2
- package/README.md +21 -18
- package/android/.gradle/6.1.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.1.1/fileContent/fileContent.lock +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/{5.4.1 → 6.1.1}/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/6.1.1/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/6.1.1/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/6.1.1/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/6.1.1/javaCompile/taskHistory.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/android.iml +24 -18
- package/android/build/generated/source/buildConfig/debug/com/clevertap/react/BuildConfig.java +2 -8
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +3 -8
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +27 -1
- package/android/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/annotations_typedef_file/debug/{extractDebugAnnotations/typedefs.txt → typedefs.txt} +0 -0
- package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +4287 -0
- package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$ErrorMessages.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$InBoxMessages.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule.class +0 -0
- package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +3 -8
- package/android/build/intermediates/local_only_symbol_list/debug/{parseDebugLibraryResources/R-def.txt → R-def.txt} +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +7 -16
- package/android/build/intermediates/merged_manifests/debug/output.json +27 -1
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +3208 -0
- package/android/build/outputs/aar/android-debug.aar +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +10 -18
- package/android/build.gradle +9 -9
- package/android/src/main/java/com/clevertap/react/CleverTapModule.java +827 -1263
- package/android/src/main/java/com/clevertap/react/CleverTapPackage.java +1 -1
- package/clevertap-react-native.podspec +1 -1
- package/docs/install.md +15 -19
- package/docs/integration.md +2 -3
- package/docs/usage.md +397 -0
- package/index.d.ts +60 -224
- package/index.js +227 -374
- package/ios/CleverTapReact/CleverTapReact.h +0 -1
- package/ios/CleverTapReact/CleverTapReact.m +33 -147
- package/ios/CleverTapReact/CleverTapReactEventEmitter.m +1 -6
- package/ios/CleverTapReact/CleverTapReactManager.m +0 -4
- package/ios/CleverTapReact/CleverTapSDK.framework.zip +0 -0
- package/package.json +1 -1
- package/.idea/clevertap-rn.iml +0 -9
- package/.idea/codeStyles/Project.xml +0 -134
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -449
- package/android/.gradle/5.4.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/5.4.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/5.4.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/5.4.1/fileContent/fileContent.lock +0 -0
- package/android/.gradle/5.4.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/5.4.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/5.4.1/gc.properties +0 -0
- package/android/.gradle/5.4.1/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/5.4.1/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/5.4.1/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/5.4.1/javaCompile/taskHistory.bin +0 -0
- package/android/.idea/caches/build_file_checksums.ser +0 -0
- package/android/.idea/caches/gradle_models.ser +0 -0
- package/android/.idea/codeStyles/Project.xml +0 -134
- package/android/.idea/dictionaries/piyush_kukadiya.xml +0 -7
- package/android/.idea/gradle.xml +0 -20
- package/android/.idea/jarRepositories.xml +0 -40
- package/android/.idea/libraries/Gradle__com_android_installreferrer_installreferrer_2_1_aar.xml +0 -11
- package/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_23_0_1_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_android_support_support_annotations_23_0_1_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_android_support_support_v4_23_0_1_aar.xml +0 -19
- package/android/.idea/libraries/Gradle__com_clevertap_android_clevertap_android_sdk_4_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__com_facebook_fbui_textlayoutbuilder_staticlayout_proxy_1_0_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_fbui_textlayoutbuilder_textlayoutbuilder_1_0_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_1_3_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_1_3_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_1_3_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_1_3_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_1_3_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_1_3_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_49_5_aar.xml +0 -19
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_1_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_0_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_parse_bolts_bolts_tasks_1_4_0_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_6_0_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_3_6_0_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_13_0_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml +0 -13
- package/android/.idea/libraries/Gradle__org_webkit_android_jsc_r174650_aar.xml +0 -11
- package/android/.idea/misc.xml +0 -14
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/runConfigurations.xml +0 -12
- package/android/.idea/vcs.xml +0 -6
- package/android/.idea/workspace.xml +0 -317
- package/android/build/generated/source/buildConfig/androidTest/debug/com/clevertap/react/test/BuildConfig.java +0 -13
- package/android/build/intermediates/annotation_processor_list/debugUnitTest/annotationProcessors.json +0 -1
- package/android/build/intermediates/javac/debugUnitTest/classes/com/clevertap/react/CleverTapModuleTest.class +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debugAndroidTest/manifest-merger-blame-debug-androidTest-report.txt +0 -98
- package/android/build/intermediates/merged_manifests/debugAndroidTest/AndroidManifest.xml +0 -57
- package/android/build/intermediates/merged_manifests/debugAndroidTest/output.json +0 -1
- package/android/build/intermediates/packaged-classes/debug/classes.jar +0 -0
- package/android/build/intermediates/res/symbol-table-with-package/debug/package-aware-r.txt +0 -1474
- package/android/build/intermediates/symbols/debug/R.txt +0 -2034
- package/clevertap-logo.png +0 -0
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DeviceEventEmitter, NativeEventEmitter, NativeModules} from 'react-native';
|
|
1
|
+
import { DeviceEventEmitter, NativeEventEmitter, NativeModules } from 'react-native';
|
|
2
2
|
|
|
3
3
|
const CleverTapReact = NativeModules.CleverTapReact;
|
|
4
4
|
const EventEmitter = NativeModules.CleverTapReactEventEmitter ? new NativeEventEmitter(NativeModules.CleverTapReactEventEmitter) : DeviceEventEmitter;
|
|
@@ -44,7 +44,6 @@ var CleverTap = {
|
|
|
44
44
|
HPS: CleverTapReact.HPS,
|
|
45
45
|
CleverTapInboxDidInitialize: CleverTapReact.CleverTapInboxDidInitialize,
|
|
46
46
|
CleverTapInboxMessagesDidUpdate: CleverTapReact.CleverTapInboxMessagesDidUpdate,
|
|
47
|
-
CleverTapExperimentsDidUpdate: CleverTapReact.CleverTapExperimentsDidUpdate,
|
|
48
47
|
CleverTapInboxMessageButtonTapped: CleverTapReact.CleverTapInboxMessageButtonTapped,
|
|
49
48
|
CleverTapDisplayUnitsLoaded: CleverTapReact.CleverTapDisplayUnitsLoaded,
|
|
50
49
|
CleverTapInAppNotificationButtonTapped: CleverTapReact.CleverTapInAppNotificationButtonTapped,
|
|
@@ -61,7 +60,7 @@ var CleverTap = {
|
|
|
61
60
|
* @param {string} eventName - the CleverTap event name
|
|
62
61
|
* @param {function(event)} your event handler
|
|
63
62
|
*/
|
|
64
|
-
addListener: function(eventName, handler) {
|
|
63
|
+
addListener: function (eventName, handler) {
|
|
65
64
|
if (EventEmitter) {
|
|
66
65
|
EventEmitter.addListener(eventName, handler);
|
|
67
66
|
}
|
|
@@ -72,17 +71,17 @@ var CleverTap = {
|
|
|
72
71
|
*
|
|
73
72
|
* @param {string} eventName - name of the event whose registered listeners to remove
|
|
74
73
|
*/
|
|
75
|
-
removeListener: function(eventName) {
|
|
74
|
+
removeListener: function (eventName) {
|
|
76
75
|
if (EventEmitter) {
|
|
77
76
|
EventEmitter.removeAllListeners(eventName);
|
|
78
77
|
}
|
|
79
78
|
},
|
|
80
79
|
|
|
81
80
|
/**
|
|
82
|
-
* Deprecated - Since version 5.0.
|
|
81
|
+
* Deprecated - Since version 0.5.0. Use removeListener(eventName) instead
|
|
83
82
|
* Remove all event listeners
|
|
84
83
|
*/
|
|
85
|
-
removeListeners: function() {
|
|
84
|
+
removeListeners: function () {
|
|
86
85
|
if (DeviceEventEmitter) {
|
|
87
86
|
DeviceEventEmitter.removeAllListeners();
|
|
88
87
|
}
|
|
@@ -92,7 +91,7 @@ var CleverTap = {
|
|
|
92
91
|
* If an application is launched from a push notification click, returns the CleverTap deep link included in the push notification
|
|
93
92
|
* @param {function(err, res)} callback that return the url as string in res or a string error in err
|
|
94
93
|
*/
|
|
95
|
-
getInitialUrl: function(callback) {
|
|
94
|
+
getInitialUrl: function (callback) {
|
|
96
95
|
callWithCallback('getInitialUrl', null, callback);
|
|
97
96
|
},
|
|
98
97
|
|
|
@@ -100,7 +99,7 @@ var CleverTap = {
|
|
|
100
99
|
* Registers the application to receive push notifications
|
|
101
100
|
* only necessary for iOS.
|
|
102
101
|
*/
|
|
103
|
-
registerForPush: function() {
|
|
102
|
+
registerForPush: function () {
|
|
104
103
|
CleverTapReact.registerForPush();
|
|
105
104
|
},
|
|
106
105
|
|
|
@@ -109,7 +108,7 @@ var CleverTap = {
|
|
|
109
108
|
* @param {string} token - the device token
|
|
110
109
|
* @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
|
|
111
110
|
*/
|
|
112
|
-
setPushToken: function(token, type) {
|
|
111
|
+
setPushToken: function (token, type) {
|
|
113
112
|
CleverTapReact.setPushTokenAsString(token, type);
|
|
114
113
|
},
|
|
115
114
|
|
|
@@ -121,8 +120,8 @@ var CleverTap = {
|
|
|
121
120
|
* @param {int} importance - An Integer value setting the importance of the notifications sent in this channel
|
|
122
121
|
* @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
|
|
123
122
|
*/
|
|
124
|
-
createNotificationChannel: function(channelId, channelName, channelDescription, importance, showBadge){
|
|
125
|
-
CleverTapReact.createNotificationChannel(channelId,channelName,channelDescription,importance,showBadge);
|
|
123
|
+
createNotificationChannel: function (channelId, channelName, channelDescription, importance, showBadge) {
|
|
124
|
+
CleverTapReact.createNotificationChannel(channelId, channelName, channelDescription, importance, showBadge);
|
|
126
125
|
},
|
|
127
126
|
|
|
128
127
|
/**
|
|
@@ -134,8 +133,8 @@ var CleverTap = {
|
|
|
134
133
|
* @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
|
|
135
134
|
* @param {string} sound - A String for setting the custom sound of the notification channel
|
|
136
135
|
*/
|
|
137
|
-
createNotificationChannelWithSound: function(channelId, channelName, channelDescription, importance, showBadge, sound){
|
|
138
|
-
CleverTapReact.createNotificationChannelWithSound(channelId,channelName,channelDescription,importance,showBadge,sound);
|
|
136
|
+
createNotificationChannelWithSound: function (channelId, channelName, channelDescription, importance, showBadge, sound) {
|
|
137
|
+
CleverTapReact.createNotificationChannelWithSound(channelId, channelName, channelDescription, importance, showBadge, sound);
|
|
139
138
|
},
|
|
140
139
|
|
|
141
140
|
/**
|
|
@@ -147,8 +146,8 @@ var CleverTap = {
|
|
|
147
146
|
* @param {string} groupId - A String for setting the notification channel as a part of a notification group
|
|
148
147
|
* @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
|
|
149
148
|
*/
|
|
150
|
-
createNotificationChannelWithGroupId: function(channelId, channelName, channelDescription, importance, groupId, showBadge){
|
|
151
|
-
CleverTapReact.createNotificationChannelWithGroupId(channelId,channelName,channelDescription,importance,groupId,showBadge);
|
|
149
|
+
createNotificationChannelWithGroupId: function (channelId, channelName, channelDescription, importance, groupId, showBadge) {
|
|
150
|
+
CleverTapReact.createNotificationChannelWithGroupId(channelId, channelName, channelDescription, importance, groupId, showBadge);
|
|
152
151
|
},
|
|
153
152
|
|
|
154
153
|
/**
|
|
@@ -161,8 +160,8 @@ var CleverTap = {
|
|
|
161
160
|
* @param {boolean} showBadge - A boolean value as to whether this channel shows a badge
|
|
162
161
|
* @param {string} sound - A String for setting the custom sound of the notification channel
|
|
163
162
|
*/
|
|
164
|
-
createNotificationChannelWithGroupIdAndSound: function(channelId, channelName, channelDescription, importance, groupId, showBadge, sound){
|
|
165
|
-
CleverTapReact.createNotificationChannelWithGroupIdAndSound(channelId,channelName,channelDescription,importance,groupId,showBadge,sound);
|
|
163
|
+
createNotificationChannelWithGroupIdAndSound: function (channelId, channelName, channelDescription, importance, groupId, showBadge, sound) {
|
|
164
|
+
CleverTapReact.createNotificationChannelWithGroupIdAndSound(channelId, channelName, channelDescription, importance, groupId, showBadge, sound);
|
|
166
165
|
},
|
|
167
166
|
|
|
168
167
|
/**
|
|
@@ -170,15 +169,15 @@ var CleverTap = {
|
|
|
170
169
|
* @param {string} groupId - A String for setting the id of the notification channel group
|
|
171
170
|
* @param {string} groupName - A String for setting the name of the notification channel group
|
|
172
171
|
*/
|
|
173
|
-
createNotificationChannelGroup: function(groupId, groupName){
|
|
174
|
-
CleverTapReact.createNotificationChannelGroup(groupId,groupName);
|
|
172
|
+
createNotificationChannelGroup: function (groupId, groupName) {
|
|
173
|
+
CleverTapReact.createNotificationChannelGroup(groupId, groupName);
|
|
175
174
|
},
|
|
176
175
|
|
|
177
176
|
/**
|
|
178
177
|
* Method to delete Notification Channels in Android O
|
|
179
178
|
* @param {string} channelId - A String for setting the id of the notification channel
|
|
180
179
|
*/
|
|
181
|
-
deleteNotificationChannel: function(channelId){
|
|
180
|
+
deleteNotificationChannel: function (channelId) {
|
|
182
181
|
CleverTapReact.deleteNotificationChannel(channelId);
|
|
183
182
|
},
|
|
184
183
|
|
|
@@ -186,7 +185,7 @@ var CleverTap = {
|
|
|
186
185
|
* Method to delete Notification Channel Groups in Android O
|
|
187
186
|
* @param {string} groupId - A String for setting the id of the notification channel group
|
|
188
187
|
*/
|
|
189
|
-
deleteNotificationChannelGroup: function(groupId){
|
|
188
|
+
deleteNotificationChannelGroup: function (groupId) {
|
|
190
189
|
CleverTapReact.deleteNotificationChannelGroup(groupId);
|
|
191
190
|
},
|
|
192
191
|
|
|
@@ -194,7 +193,7 @@ var CleverTap = {
|
|
|
194
193
|
* Method to show the App Inbox
|
|
195
194
|
* @param {object} extras - key-value data from RemoteMessage.getData(). keys and values are strings
|
|
196
195
|
*/
|
|
197
|
-
createNotification: function(extras) {
|
|
196
|
+
createNotification: function (extras) {
|
|
198
197
|
CleverTapReact.createNotification(extras);
|
|
199
198
|
},
|
|
200
199
|
|
|
@@ -202,7 +201,7 @@ var CleverTap = {
|
|
|
202
201
|
* Enables tracking opt out for the currently active user.
|
|
203
202
|
* @param {boolean} value - A boolean for enabling or disabling tracking for current user
|
|
204
203
|
*/
|
|
205
|
-
setOptOut: function(value){
|
|
204
|
+
setOptOut: function (value) {
|
|
206
205
|
CleverTapReact.setOptOut(value);
|
|
207
206
|
},
|
|
208
207
|
|
|
@@ -210,7 +209,7 @@ var CleverTap = {
|
|
|
210
209
|
* Sets the CleverTap SDK to offline mode
|
|
211
210
|
* @param {boolean} value - A boolean for enabling or disabling sending events for current user
|
|
212
211
|
*/
|
|
213
|
-
setOffline: function(value){
|
|
212
|
+
setOffline: function (value) {
|
|
214
213
|
CleverTapReact.setOffline(value);
|
|
215
214
|
},
|
|
216
215
|
|
|
@@ -218,21 +217,21 @@ var CleverTap = {
|
|
|
218
217
|
* Enables the reporting of device network related information, including IP address. This reporting is disabled by default.
|
|
219
218
|
* @param {boolean} - A boolean for enabling or disabling device network related information to be sent to CleverTap
|
|
220
219
|
*/
|
|
221
|
-
enableDeviceNetworkInfoReporting: function(value){
|
|
220
|
+
enableDeviceNetworkInfoReporting: function (value) {
|
|
222
221
|
CleverTapReact.enableDeviceNetworkInfoReporting(value);
|
|
223
222
|
},
|
|
224
223
|
|
|
225
224
|
/**
|
|
226
225
|
* Enables the personalization API. Call this prior to using the profile/event API getters
|
|
227
226
|
*/
|
|
228
|
-
enablePersonalization: function() {
|
|
227
|
+
enablePersonalization: function () {
|
|
229
228
|
CleverTapReact.enablePersonalization();
|
|
230
229
|
},
|
|
231
230
|
|
|
232
231
|
/**
|
|
233
232
|
* Disables the personalization API.
|
|
234
233
|
*/
|
|
235
|
-
disablePersonalization: function() {
|
|
234
|
+
disablePersonalization: function () {
|
|
236
235
|
CleverTapReact.disablePersonalization();
|
|
237
236
|
},
|
|
238
237
|
|
|
@@ -240,7 +239,7 @@ var CleverTap = {
|
|
|
240
239
|
* Record a Screen View
|
|
241
240
|
* @param {string} screenName - the name of the screen
|
|
242
241
|
*/
|
|
243
|
-
recordScreenView: function(screenName) {
|
|
242
|
+
recordScreenView: function (screenName) {
|
|
244
243
|
CleverTapReact.recordScreenView(screenName);
|
|
245
244
|
},
|
|
246
245
|
|
|
@@ -250,7 +249,8 @@ var CleverTap = {
|
|
|
250
249
|
* @param {object} props - the key-value properties of the event.
|
|
251
250
|
* keys are strings and values can be string, number or boolean.
|
|
252
251
|
*/
|
|
253
|
-
recordEvent: function(eventName, props) {
|
|
252
|
+
recordEvent: function (eventName, props) {
|
|
253
|
+
convertDateToEpochInProperties(props);
|
|
254
254
|
CleverTapReact.recordEvent(eventName, props);
|
|
255
255
|
},
|
|
256
256
|
|
|
@@ -259,7 +259,13 @@ var CleverTap = {
|
|
|
259
259
|
* @param {object} details - the key-value properties for the transaction.
|
|
260
260
|
* @param {array<object>} items - an array of objects containing the key-value data for the items that make up the transaction.
|
|
261
261
|
*/
|
|
262
|
-
recordChargedEvent: function(details, items) {
|
|
262
|
+
recordChargedEvent: function (details, items) {
|
|
263
|
+
convertDateToEpochInProperties(details);
|
|
264
|
+
if (Array.isArray(items) && items.length) {
|
|
265
|
+
items.forEach(value => {
|
|
266
|
+
convertDateToEpochInProperties(value);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
263
269
|
CleverTapReact.recordChargedEvent(details, items);
|
|
264
270
|
},
|
|
265
271
|
|
|
@@ -268,7 +274,7 @@ var CleverTap = {
|
|
|
268
274
|
* @param {string} eventName - the name of the event
|
|
269
275
|
* @param {function(err, res)} callback that returns a res of epoch seconds or -1
|
|
270
276
|
*/
|
|
271
|
-
eventGetFirstTime: function(eventName, callback) {
|
|
277
|
+
eventGetFirstTime: function (eventName, callback) {
|
|
272
278
|
callWithCallback('eventGetFirstTime', [eventName], callback);
|
|
273
279
|
},
|
|
274
280
|
|
|
@@ -277,7 +283,7 @@ var CleverTap = {
|
|
|
277
283
|
* @param {string} eventName - the name of the event
|
|
278
284
|
* @param {function(err, res)} callback that returns a res of epoch seconds or -1
|
|
279
285
|
*/
|
|
280
|
-
eventGetLastTime: function(eventName, callback) {
|
|
286
|
+
eventGetLastTime: function (eventName, callback) {
|
|
281
287
|
callWithCallback('eventGetLastTime', [eventName], callback);
|
|
282
288
|
},
|
|
283
289
|
|
|
@@ -286,7 +292,7 @@ var CleverTap = {
|
|
|
286
292
|
* @param {string} eventName - the name of the event
|
|
287
293
|
* @param {function(err, res)} callback that returns a res of int
|
|
288
294
|
*/
|
|
289
|
-
eventGetOccurrences: function(eventName, callback) {
|
|
295
|
+
eventGetOccurrences: function (eventName, callback) {
|
|
290
296
|
callWithCallback('eventGetOccurrences', [eventName], callback);
|
|
291
297
|
},
|
|
292
298
|
|
|
@@ -295,7 +301,7 @@ var CleverTap = {
|
|
|
295
301
|
* @param {string} eventName - the name of the event
|
|
296
302
|
* @param {function(err, res)} callback that returns a res of object {"eventName": <string>, "firstTime":<epoch seconds>, "lastTime": <epoch seconds>, "count": <int>} or empty object
|
|
297
303
|
*/
|
|
298
|
-
eventGetDetail: function(eventName, callback) {
|
|
304
|
+
eventGetDetail: function (eventName, callback) {
|
|
299
305
|
callWithCallback('eventGetDetail', [eventName], callback);
|
|
300
306
|
},
|
|
301
307
|
|
|
@@ -303,7 +309,7 @@ var CleverTap = {
|
|
|
303
309
|
* Get the user's event history
|
|
304
310
|
* @param {function(err, res)} callback that returns a res of object {"eventName1":<event1 details object>, "eventName2":<event2 details object>}
|
|
305
311
|
*/
|
|
306
|
-
getEventHistory: function(callback) {
|
|
312
|
+
getEventHistory: function (callback) {
|
|
307
313
|
callWithCallback('getEventHistory', null, callback);
|
|
308
314
|
},
|
|
309
315
|
|
|
@@ -312,23 +318,25 @@ var CleverTap = {
|
|
|
312
318
|
* @param {float} latitude
|
|
313
319
|
* @param {float} longitude
|
|
314
320
|
*/
|
|
315
|
-
setLocation: function(latitude, longitude) {
|
|
321
|
+
setLocation: function (latitude, longitude) {
|
|
316
322
|
CleverTapReact.setLocation(latitude, longitude);
|
|
317
323
|
},
|
|
318
324
|
|
|
319
325
|
/**
|
|
326
|
+
* Deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
|
|
320
327
|
* Get a unique CleverTap identifier suitable for use with install attribution providers
|
|
321
328
|
* @param {function(err, res)} callback that returns a string res
|
|
322
329
|
*/
|
|
323
|
-
profileGetCleverTapAttributionIdentifier: function(callback) {
|
|
330
|
+
profileGetCleverTapAttributionIdentifier: function (callback) {
|
|
324
331
|
callWithCallback('profileGetCleverTapAttributionIdentifier', null, callback);
|
|
325
332
|
},
|
|
326
333
|
|
|
327
334
|
/**
|
|
335
|
+
* Deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
|
|
328
336
|
* Get the user profile's CleverTap identifier value
|
|
329
337
|
* @param {function(err, res)} callback that returns a string res
|
|
330
338
|
*/
|
|
331
|
-
profileGetCleverTapID: function(callback) {
|
|
339
|
+
profileGetCleverTapID: function (callback) {
|
|
332
340
|
callWithCallback('profileGetCleverTapID', null, callback);
|
|
333
341
|
},
|
|
334
342
|
|
|
@@ -347,7 +355,8 @@ var CleverTap = {
|
|
|
347
355
|
* In addition, any global frequency caps are reset as part of the switch.
|
|
348
356
|
* @param {object} profile - key-value profile properties. keys are strings and values can be string, number or boolean.
|
|
349
357
|
*/
|
|
350
|
-
onUserLogin: function(profile) {
|
|
358
|
+
onUserLogin: function (profile) {
|
|
359
|
+
convertDateToEpochInProperties(profile);
|
|
351
360
|
CleverTapReact.onUserLogin(profile);
|
|
352
361
|
},
|
|
353
362
|
|
|
@@ -355,24 +364,17 @@ var CleverTap = {
|
|
|
355
364
|
* Set key-value properties on a user profile
|
|
356
365
|
* @param {object} profile - key-value profile properties. keys are strings and values can be string, number or boolean.
|
|
357
366
|
*/
|
|
358
|
-
profileSet: function(profile) {
|
|
367
|
+
profileSet: function (profile) {
|
|
368
|
+
convertDateToEpochInProperties(profile);
|
|
359
369
|
CleverTapReact.profileSet(profile);
|
|
360
370
|
},
|
|
361
371
|
|
|
362
|
-
/**
|
|
363
|
-
* Set key-value facebook properties on a user profile
|
|
364
|
-
* @param {object} profile - key-value profile properties. keys are strings and values can be string, number or boolean.
|
|
365
|
-
*/
|
|
366
|
-
profileSetGraphUser: function(user) {
|
|
367
|
-
CleverTapReact.profileSetGraphUser(user);
|
|
368
|
-
},
|
|
369
|
-
|
|
370
372
|
/**
|
|
371
373
|
* Get the value of a profile property
|
|
372
374
|
* @param {string} the property key
|
|
373
375
|
* @param {function(err, res)} callback that returns a res of the property value or null
|
|
374
376
|
*/
|
|
375
|
-
profileGetProperty: function(key, callback) {
|
|
377
|
+
profileGetProperty: function (key, callback) {
|
|
376
378
|
callWithCallback('profileGetProperty', [key], callback);
|
|
377
379
|
},
|
|
378
380
|
|
|
@@ -380,7 +382,7 @@ var CleverTap = {
|
|
|
380
382
|
* Remove a key-value from the user profile
|
|
381
383
|
* @param {string} the key to remove
|
|
382
384
|
*/
|
|
383
|
-
profileRemoveValueForKey: function(key) {
|
|
385
|
+
profileRemoveValueForKey: function (key) {
|
|
384
386
|
CleverTapReact.profileRemoveValueForKey(key);
|
|
385
387
|
},
|
|
386
388
|
|
|
@@ -389,7 +391,7 @@ var CleverTap = {
|
|
|
389
391
|
* @param {array} an array of string values
|
|
390
392
|
* @param {string} the property key
|
|
391
393
|
*/
|
|
392
|
-
profileSetMultiValuesForKey: function(values, key) {
|
|
394
|
+
profileSetMultiValuesForKey: function (values, key) {
|
|
393
395
|
CleverTapReact.profileSetMultiValues(values, key);
|
|
394
396
|
},
|
|
395
397
|
|
|
@@ -398,7 +400,7 @@ var CleverTap = {
|
|
|
398
400
|
* @param {string} value
|
|
399
401
|
* @param {string} the property key
|
|
400
402
|
*/
|
|
401
|
-
profileAddMultiValueForKey: function(value, key) {
|
|
403
|
+
profileAddMultiValueForKey: function (value, key) {
|
|
402
404
|
CleverTapReact.profileAddMultiValue(value, key);
|
|
403
405
|
},
|
|
404
406
|
|
|
@@ -407,7 +409,7 @@ var CleverTap = {
|
|
|
407
409
|
* @param {array} an array of string values
|
|
408
410
|
* @param {string} the property key
|
|
409
411
|
*/
|
|
410
|
-
profileAddMultiValuesForKey: function(values, key) {
|
|
412
|
+
profileAddMultiValuesForKey: function (values, key) {
|
|
411
413
|
CleverTapReact.profileAddMultiValues(values, key);
|
|
412
414
|
},
|
|
413
415
|
|
|
@@ -416,7 +418,7 @@ var CleverTap = {
|
|
|
416
418
|
* @param {string} value
|
|
417
419
|
* @param {string} the property key
|
|
418
420
|
*/
|
|
419
|
-
profileRemoveMultiValueForKey: function(value, key) {
|
|
421
|
+
profileRemoveMultiValueForKey: function (value, key) {
|
|
420
422
|
CleverTapReact.profileRemoveMultiValue(value, key);
|
|
421
423
|
},
|
|
422
424
|
|
|
@@ -425,17 +427,37 @@ var CleverTap = {
|
|
|
425
427
|
* @param {array} an array of string values
|
|
426
428
|
* @param {string} the property key
|
|
427
429
|
*/
|
|
428
|
-
profileRemoveMultiValuesForKey: function(values, key) {
|
|
430
|
+
profileRemoveMultiValuesForKey: function (values, key) {
|
|
429
431
|
CleverTapReact.profileRemoveMultiValues(values, key);
|
|
430
432
|
},
|
|
431
433
|
|
|
434
|
+
/**
|
|
435
|
+
* This method is used to increment the given value
|
|
436
|
+
*
|
|
437
|
+
* @param value {Number} can be int,double or float only (NaN,Infinity etc not supported)
|
|
438
|
+
* @param key {string} profile property
|
|
439
|
+
*/
|
|
440
|
+
profileIncrementValueForKey: function (value, key) {
|
|
441
|
+
CleverTapReact.profileIncrementValueForKey(value, key);
|
|
442
|
+
},
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* This method is used to decrement the given value
|
|
446
|
+
*
|
|
447
|
+
* @param value {Number} can be int,double or float only (NaN,Infinity etc not supported)
|
|
448
|
+
* @param key {string} profile property
|
|
449
|
+
*/
|
|
450
|
+
profileDecrementValueForKey: function (value, key) {
|
|
451
|
+
CleverTapReact.profileDecrementValueForKey(value, key);
|
|
452
|
+
},
|
|
453
|
+
|
|
432
454
|
/**
|
|
433
455
|
* Manually track the utm app install referrer
|
|
434
456
|
* @param {string} the utm referrer source
|
|
435
457
|
* @param {string} the utm referrer medium
|
|
436
458
|
* @param {string} the utm referrer campaign
|
|
437
459
|
*/
|
|
438
|
-
pushInstallReferrer: function(source, medium, campaign) {
|
|
460
|
+
pushInstallReferrer: function (source, medium, campaign) {
|
|
439
461
|
CleverTapReact.pushInstallReferrer(source, medium, campaign);
|
|
440
462
|
},
|
|
441
463
|
|
|
@@ -443,7 +465,7 @@ var CleverTap = {
|
|
|
443
465
|
* Get the elapsed time of the current user session
|
|
444
466
|
* @param {function(err, res)} callback that returns a res of int seconds
|
|
445
467
|
*/
|
|
446
|
-
sessionGetTimeElapsed: function(callback) {
|
|
468
|
+
sessionGetTimeElapsed: function (callback) {
|
|
447
469
|
callWithCallback('sessionGetTimeElapsed', null, callback);
|
|
448
470
|
},
|
|
449
471
|
|
|
@@ -451,7 +473,7 @@ var CleverTap = {
|
|
|
451
473
|
* Get the total number of vists by the user
|
|
452
474
|
* @param {function(err, res)} callback that returns a res of int
|
|
453
475
|
*/
|
|
454
|
-
sessionGetTotalVisits: function(callback) {
|
|
476
|
+
sessionGetTotalVisits: function (callback) {
|
|
455
477
|
callWithCallback('sessionGetTotalVisits', null, callback);
|
|
456
478
|
},
|
|
457
479
|
|
|
@@ -459,7 +481,7 @@ var CleverTap = {
|
|
|
459
481
|
* Get the number of screens viewed by the user during the session
|
|
460
482
|
* @param {function(err, res)} callback that returns a res of int
|
|
461
483
|
*/
|
|
462
|
-
sessionGetScreenCount: function(callback) {
|
|
484
|
+
sessionGetScreenCount: function (callback) {
|
|
463
485
|
callWithCallback('sessionGetScreenCount', null, callback);
|
|
464
486
|
},
|
|
465
487
|
|
|
@@ -467,7 +489,7 @@ var CleverTap = {
|
|
|
467
489
|
* Get the most recent previous visit time of the user
|
|
468
490
|
* @param {function(err, res)} callback that returns a res of epoch seconds or -1
|
|
469
491
|
*/
|
|
470
|
-
sessionGetPreviousVisitTime: function(callback) {
|
|
492
|
+
sessionGetPreviousVisitTime: function (callback) {
|
|
471
493
|
callWithCallback('sessionGetPreviousVisitTime', null, callback);
|
|
472
494
|
},
|
|
473
495
|
|
|
@@ -475,14 +497,14 @@ var CleverTap = {
|
|
|
475
497
|
* Get the utm referrer info for the current session
|
|
476
498
|
* @param {function(err, res)} callback that returns a res of object {"source": <string>, "medium": <string>, "campaign": <string>} or empty object
|
|
477
499
|
*/
|
|
478
|
-
sessionGetUTMDetails: function(callback) {
|
|
500
|
+
sessionGetUTMDetails: function (callback) {
|
|
479
501
|
callWithCallback('sessionGetUTMDetails', null, callback);
|
|
480
502
|
},
|
|
481
503
|
|
|
482
504
|
/**
|
|
483
505
|
* Method to initalize the App Inbox
|
|
484
506
|
*/
|
|
485
|
-
initializeInbox: function() {
|
|
507
|
+
initializeInbox: function () {
|
|
486
508
|
CleverTapReact.initializeInbox();
|
|
487
509
|
},
|
|
488
510
|
|
|
@@ -490,389 +512,165 @@ var CleverTap = {
|
|
|
490
512
|
* Method to show the App Inbox
|
|
491
513
|
* @param {object} styleConfig - key-value profile properties. keys and values are strings
|
|
492
514
|
*/
|
|
493
|
-
showInbox: function(styleConfig) {
|
|
515
|
+
showInbox: function (styleConfig) {
|
|
494
516
|
CleverTapReact.showInbox(styleConfig);
|
|
495
517
|
},
|
|
496
518
|
|
|
497
|
-
/**
|
|
498
|
-
* Get the total number of Inbox Messages
|
|
499
|
-
* @param {function(err, res)} callback that returns a res of count of inbox messages or -1
|
|
500
|
-
*/
|
|
501
|
-
getInboxMessageCount: function(callback) {
|
|
502
|
-
callWithCallback('getInboxMessageCount', null, callback);
|
|
503
|
-
},
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Get the total number of Unread Inbox Messages
|
|
507
|
-
* @param {function(err, res)} callback that returns a res of count of unread inbox messages or -1
|
|
508
|
-
*/
|
|
509
|
-
getInboxMessageUnreadCount: function(callback) {
|
|
510
|
-
callWithCallback('getInboxMessageUnreadCount', null, callback);
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Get All inbox messages
|
|
515
|
-
* @param {function(err, res)} callback that returns a list of json string representation of CTInboxMessage
|
|
516
|
-
*/
|
|
517
|
-
getAllInboxMessages : function(callback){
|
|
518
|
-
callWithCallback('getAllInboxMessages', null, callback);
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
/**
|
|
522
|
-
* Get All unread inbox messages
|
|
523
|
-
* @param {function(err, res)} callback that returns a list of json string representation of CTInboxMessage
|
|
524
|
-
*/
|
|
525
|
-
getUnreadInboxMessages: function(callback) {
|
|
526
|
-
callWithCallback('getUnreadInboxMessages', null, callback);
|
|
527
|
-
},
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Get Inbox Message that belongs to the given message id
|
|
531
|
-
* @param {function(err, res)} callback that returns json string representation of CTInboxMessage
|
|
532
|
-
*/
|
|
533
|
-
getInboxMessageForId: function(messageId,callback) {
|
|
534
|
-
callWithCallback('getInboxMessageForId', [messageId], callback);
|
|
535
|
-
},
|
|
536
|
-
|
|
537
|
-
/**
|
|
538
|
-
* Deletes Inbox Message that belongs to the given message id
|
|
539
|
-
* @param {string} message id of inbox message of type CTInboxMessage
|
|
540
|
-
*/
|
|
541
|
-
deleteInboxMessageForId:function(messageId) {
|
|
542
|
-
CleverTapReact.deleteInboxMessageForId(messageId);
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Marks Inbox Message that belongs to the given message id as read
|
|
547
|
-
* @param {string} message id of inbox message of type CTInboxMessage
|
|
548
|
-
*/
|
|
549
|
-
markReadInboxMessageForId:function(messageId) {
|
|
550
|
-
CleverTapReact.markReadInboxMessageForId(messageId);
|
|
551
|
-
},
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* Pushes the Notification Clicked event for App Inbox to CleverTap.
|
|
555
|
-
* @param {string} message id of inbox message of type CTInboxMessage
|
|
556
|
-
*/
|
|
557
|
-
pushInboxNotificationClickedEventForId: function(messageId) {
|
|
558
|
-
CleverTapReact.pushInboxNotificationClickedEventForId(messageId);
|
|
559
|
-
},
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* Pushes the Notification Viewed event for App Inbox to CleverTap.
|
|
563
|
-
* @param {string} message id of inbox message of type CTInboxMessage
|
|
564
|
-
*/
|
|
565
|
-
pushInboxNotificationViewedEventForId: function(messageId) {
|
|
566
|
-
CleverTapReact.pushInboxNotificationViewedEventForId(messageId);
|
|
567
|
-
},
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Get all display units
|
|
571
|
-
* @param {function(err, res)} callback that returns a list of json string representation of CleverTapDisplayUnit
|
|
572
|
-
*/
|
|
573
|
-
getAllDisplayUnits: function(callback) {
|
|
574
|
-
callWithCallback('getAllDisplayUnits', null, callback);
|
|
575
|
-
},
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* Get display unit for given unitID.
|
|
579
|
-
* @param {string} unit id of display unit of type CleverTapDisplayUnit
|
|
580
|
-
* @param {function(err, res)} callback that returns a json string representation of CleverTapDisplayUnit
|
|
581
|
-
*/
|
|
582
|
-
getDisplayUnitForId: function(unitID,callback) {
|
|
583
|
-
callWithCallback('getDisplayUnitForId', [unitID], callback);
|
|
584
|
-
},
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Raises the Display Unit Viewed event
|
|
588
|
-
* @param {string} unit id of display unit of type CleverTapDisplayUnit
|
|
589
|
-
*/
|
|
590
|
-
pushDisplayUnitViewedEventForID: function(unitID) {
|
|
591
|
-
CleverTapReact.pushDisplayUnitViewedEventForID(unitID);
|
|
592
|
-
},
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Raises the Display Unit Clicked event
|
|
596
|
-
* @param {string} unit id of display unit of type CleverTapDisplayUnit
|
|
597
|
-
*/
|
|
598
|
-
pushDisplayUnitClickedEventForID: function(unitID) {
|
|
599
|
-
CleverTapReact.pushDisplayUnitClickedEventForID(unitID);
|
|
600
|
-
},
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Registers an ABTesting variable of type Boolean for ease of editing on the CleverTap Dashboard
|
|
604
|
-
* @param name {String} the name of the variable
|
|
605
|
-
*/
|
|
606
|
-
registerBooleanVariable: function(name){
|
|
607
|
-
CleverTapReact.registerBooleanVariable(name);
|
|
608
|
-
},
|
|
609
|
-
|
|
610
519
|
/**
|
|
611
|
-
*
|
|
612
|
-
* @param
|
|
520
|
+
* Get the total number of Inbox Messages
|
|
521
|
+
* @param {function(err, res)} callback that returns a res of count of inbox messages or -1
|
|
613
522
|
*/
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* Registers an ABTesting variable of type Integer for ease of editing on the CleverTap Dashboard
|
|
620
|
-
* @param name {String} the name of the variable
|
|
621
|
-
*/
|
|
622
|
-
registerIntegerVariable: function(name){
|
|
623
|
-
CleverTapReact.registerIntegerVariable(name);
|
|
624
|
-
},
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* Registers an ABTesting variable of type String for ease of editing on the CleverTap Dashboard
|
|
628
|
-
* @param name {String} the name of the variable
|
|
629
|
-
*/
|
|
630
|
-
registerStringVariable: function(name){
|
|
631
|
-
CleverTapReact.registerStringVariable(name);
|
|
632
|
-
},
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Registers an ABTesting variable of type List of Boolean for ease of editing on the CleverTap Dashboard
|
|
636
|
-
* @param name {String} the name of the variable
|
|
637
|
-
*/
|
|
638
|
-
registerListOfBooleanVariable: function(name){
|
|
639
|
-
CleverTapReact.registerListOfBooleanVariable(name);
|
|
523
|
+
getInboxMessageCount: function (callback) {
|
|
524
|
+
callWithCallback('getInboxMessageCount', null, callback);
|
|
640
525
|
},
|
|
641
526
|
|
|
642
527
|
/**
|
|
643
|
-
*
|
|
644
|
-
* @param
|
|
528
|
+
* Get the total number of Unread Inbox Messages
|
|
529
|
+
* @param {function(err, res)} callback that returns a res of count of unread inbox messages or -1
|
|
645
530
|
*/
|
|
646
|
-
|
|
647
|
-
|
|
531
|
+
getInboxMessageUnreadCount: function (callback) {
|
|
532
|
+
callWithCallback('getInboxMessageUnreadCount', null, callback);
|
|
648
533
|
},
|
|
649
534
|
|
|
650
535
|
/**
|
|
651
|
-
*
|
|
652
|
-
* @param
|
|
536
|
+
* Get All inbox messages
|
|
537
|
+
* @param {function(err, res)} callback that returns a list of json string representation of CTInboxMessage
|
|
653
538
|
*/
|
|
654
|
-
|
|
655
|
-
|
|
539
|
+
getAllInboxMessages: function (callback) {
|
|
540
|
+
callWithCallback('getAllInboxMessages', null, callback);
|
|
656
541
|
},
|
|
657
542
|
|
|
658
543
|
/**
|
|
659
|
-
*
|
|
660
|
-
* @param
|
|
544
|
+
* Get All unread inbox messages
|
|
545
|
+
* @param {function(err, res)} callback that returns a list of json string representation of CTInboxMessage
|
|
661
546
|
*/
|
|
662
|
-
|
|
663
|
-
|
|
547
|
+
getUnreadInboxMessages: function (callback) {
|
|
548
|
+
callWithCallback('getUnreadInboxMessages', null, callback);
|
|
664
549
|
},
|
|
665
550
|
|
|
666
551
|
/**
|
|
667
|
-
*
|
|
668
|
-
* @param
|
|
552
|
+
* Get Inbox Message that belongs to the given message id
|
|
553
|
+
* @param {function(err, res)} callback that returns json string representation of CTInboxMessage
|
|
669
554
|
*/
|
|
670
|
-
|
|
671
|
-
|
|
555
|
+
getInboxMessageForId: function (messageId, callback) {
|
|
556
|
+
callWithCallback('getInboxMessageForId', [messageId], callback);
|
|
672
557
|
},
|
|
673
558
|
|
|
674
559
|
/**
|
|
675
|
-
*
|
|
676
|
-
* @param
|
|
560
|
+
* Deletes Inbox Message that belongs to the given message id
|
|
561
|
+
* @param {string} message id of inbox message of type CTInboxMessage
|
|
677
562
|
*/
|
|
678
|
-
|
|
679
|
-
CleverTapReact.
|
|
563
|
+
deleteInboxMessageForId: function (messageId) {
|
|
564
|
+
CleverTapReact.deleteInboxMessageForId(messageId);
|
|
680
565
|
},
|
|
681
566
|
|
|
682
567
|
/**
|
|
683
|
-
*
|
|
684
|
-
* @param
|
|
568
|
+
* Marks Inbox Message that belongs to the given message id as read
|
|
569
|
+
* @param {string} message id of inbox message of type CTInboxMessage
|
|
685
570
|
*/
|
|
686
|
-
|
|
687
|
-
CleverTapReact.
|
|
571
|
+
markReadInboxMessageForId: function (messageId) {
|
|
572
|
+
CleverTapReact.markReadInboxMessageForId(messageId);
|
|
688
573
|
},
|
|
689
574
|
|
|
690
575
|
/**
|
|
691
|
-
*
|
|
692
|
-
* @param
|
|
576
|
+
* Pushes the Notification Clicked event for App Inbox to CleverTap.
|
|
577
|
+
* @param {string} message id of inbox message of type CTInboxMessage
|
|
693
578
|
*/
|
|
694
|
-
|
|
695
|
-
CleverTapReact.
|
|
579
|
+
pushInboxNotificationClickedEventForId: function (messageId) {
|
|
580
|
+
CleverTapReact.pushInboxNotificationClickedEventForId(messageId);
|
|
696
581
|
},
|
|
697
582
|
|
|
698
583
|
/**
|
|
699
|
-
*
|
|
700
|
-
* @param
|
|
701
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
702
|
-
* @return {Boolean} the value set by the Experiment or the default value if unset
|
|
584
|
+
* Pushes the Notification Viewed event for App Inbox to CleverTap.
|
|
585
|
+
* @param {string} message id of inbox message of type CTInboxMessage
|
|
703
586
|
*/
|
|
704
|
-
|
|
705
|
-
|
|
587
|
+
pushInboxNotificationViewedEventForId: function (messageId) {
|
|
588
|
+
CleverTapReact.pushInboxNotificationViewedEventForId(messageId);
|
|
706
589
|
},
|
|
707
590
|
|
|
708
591
|
/**
|
|
709
|
-
*
|
|
710
|
-
* @param
|
|
711
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
712
|
-
* @return {Double} the value set by the Experiment or the default value if unset
|
|
592
|
+
* Get all display units
|
|
593
|
+
* @param {function(err, res)} callback that returns a list of json string representation of CleverTapDisplayUnit
|
|
713
594
|
*/
|
|
714
|
-
|
|
715
|
-
callWithCallback('
|
|
595
|
+
getAllDisplayUnits: function (callback) {
|
|
596
|
+
callWithCallback('getAllDisplayUnits', null, callback);
|
|
716
597
|
},
|
|
717
598
|
|
|
718
599
|
/**
|
|
719
|
-
*
|
|
720
|
-
* @param
|
|
721
|
-
* @param
|
|
722
|
-
* @return {Integer} the value set by the Experiment or the default value if unset
|
|
600
|
+
* Get display unit for given unitID.
|
|
601
|
+
* @param {string} unit id of display unit of type CleverTapDisplayUnit
|
|
602
|
+
* @param {function(err, res)} callback that returns a json string representation of CleverTapDisplayUnit
|
|
723
603
|
*/
|
|
724
|
-
|
|
725
|
-
callWithCallback('
|
|
604
|
+
getDisplayUnitForId: function (unitID, callback) {
|
|
605
|
+
callWithCallback('getDisplayUnitForId', [unitID], callback);
|
|
726
606
|
},
|
|
727
607
|
|
|
728
608
|
/**
|
|
729
|
-
*
|
|
730
|
-
* @param
|
|
731
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
732
|
-
* @return {String} the value set by the Experiment or the default value if unset
|
|
609
|
+
* Raises the Display Unit Viewed event
|
|
610
|
+
* @param {string} unit id of display unit of type CleverTapDisplayUnit
|
|
733
611
|
*/
|
|
734
|
-
|
|
735
|
-
|
|
612
|
+
pushDisplayUnitViewedEventForID: function (unitID) {
|
|
613
|
+
CleverTapReact.pushDisplayUnitViewedEventForID(unitID);
|
|
736
614
|
},
|
|
737
615
|
|
|
738
|
-
|
|
739
616
|
/**
|
|
740
|
-
*
|
|
741
|
-
* @param
|
|
742
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
743
|
-
* @return {List of Boolean} the value set by the Experiment or the default value if unset
|
|
617
|
+
* Raises the Display Unit Clicked event
|
|
618
|
+
* @param {string} unit id of display unit of type CleverTapDisplayUnit
|
|
744
619
|
*/
|
|
745
|
-
|
|
746
|
-
|
|
620
|
+
pushDisplayUnitClickedEventForID: function (unitID) {
|
|
621
|
+
CleverTapReact.pushDisplayUnitClickedEventForID(unitID);
|
|
747
622
|
},
|
|
748
623
|
|
|
749
|
-
/**
|
|
750
|
-
* Returns the List of Double value of the named variable set via an AB Testing Experiment or the default value if unset
|
|
751
|
-
* @param name - the name of the variable
|
|
752
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
753
|
-
* @return {List of Double} the value set by the Experiment or the default value if unset
|
|
754
|
-
*/
|
|
755
|
-
getListOfDoubleVariable: function(name,defaultValue,callback){
|
|
756
|
-
callWithCallback('getListOfDoubleVariable', [name,defaultValue], callback);
|
|
757
|
-
},
|
|
758
624
|
|
|
759
625
|
/**
|
|
760
|
-
*
|
|
761
|
-
* @param
|
|
762
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
763
|
-
* @return {List of Integer} the value set by the Experiment or the default value if unset
|
|
626
|
+
* Sets default product config params using the given object.
|
|
627
|
+
* @param {object} productConfigMap - key-value product config properties. keys are strings and values can be string, double, integer, boolean or json in string format.
|
|
764
628
|
*/
|
|
765
|
-
|
|
766
|
-
|
|
629
|
+
setDefaultsMap: function (productConfigMap) {
|
|
630
|
+
CleverTapReact.setDefaultsMap(productConfigMap);
|
|
767
631
|
},
|
|
768
632
|
|
|
769
633
|
/**
|
|
770
|
-
*
|
|
771
|
-
* @param name - the name of the variable
|
|
772
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
773
|
-
* @return {List of String} the value set by the Experiment or the default value if unset
|
|
634
|
+
* Starts fetching product configs, adhering to the default minimum fetch interval.
|
|
774
635
|
*/
|
|
775
|
-
|
|
776
|
-
|
|
636
|
+
fetch: function () {
|
|
637
|
+
CleverTapReact.fetch();
|
|
777
638
|
},
|
|
778
639
|
|
|
779
640
|
/**
|
|
780
|
-
*
|
|
781
|
-
* @param
|
|
782
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
783
|
-
* @return {Map of Boolean} the value set by the Experiment or the default value if unset
|
|
641
|
+
* Starts fetching product configs, adhering to the specified minimum fetch interval in seconds.
|
|
642
|
+
* @param {int} intervalInSecs - minimum fetch interval in seconds.
|
|
784
643
|
*/
|
|
785
|
-
|
|
786
|
-
|
|
644
|
+
fetchWithMinimumIntervalInSeconds: function (intervalInSecs) {
|
|
645
|
+
CleverTapReact.fetchWithMinimumFetchIntervalInSeconds(intervalInSecs);
|
|
787
646
|
},
|
|
788
647
|
|
|
789
648
|
/**
|
|
790
|
-
*
|
|
791
|
-
* @param name - the name of the variable
|
|
792
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
793
|
-
* @return {Map of Double} the value set by the Experiment or the default value if unset
|
|
649
|
+
* Activates the most recently fetched product configs, so that the fetched key value pairs take effect.
|
|
794
650
|
*/
|
|
795
|
-
|
|
796
|
-
|
|
651
|
+
activate: function () {
|
|
652
|
+
CleverTapReact.activate();
|
|
797
653
|
},
|
|
798
654
|
|
|
799
655
|
/**
|
|
800
|
-
*
|
|
801
|
-
* @param name - the name of the variable
|
|
802
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
803
|
-
* @return {Map of Integer} the value set by the Experiment or the default value if unset
|
|
656
|
+
* Asynchronously fetches and then activates the fetched product configs.
|
|
804
657
|
*/
|
|
805
|
-
|
|
806
|
-
|
|
658
|
+
fetchAndActivate: function () {
|
|
659
|
+
CleverTapReact.fetchAndActivate();
|
|
807
660
|
},
|
|
808
661
|
|
|
809
662
|
/**
|
|
810
|
-
*
|
|
811
|
-
* @param
|
|
812
|
-
* @param defaultValue - the default value to return if the value has not been set via an AB Testing Experiment
|
|
813
|
-
* @return {Map of String} the value set by the Experiment or the default value if unset
|
|
663
|
+
* Sets the minimum interval in seconds between successive fetch calls.
|
|
664
|
+
* @param {int} intervalInSecs - interval in seconds between successive fetch calls.
|
|
814
665
|
*/
|
|
815
|
-
|
|
816
|
-
|
|
666
|
+
setMinimumFetchIntervalInSeconds: function (intervalInSecs) {
|
|
667
|
+
CleverTapReact.setMinimumFetchIntervalInSeconds(intervalInSecs);
|
|
817
668
|
},
|
|
818
669
|
|
|
819
670
|
/**
|
|
820
|
-
*
|
|
821
|
-
* Disabled by default
|
|
671
|
+
* Deletes all activated, fetched and defaults configs as well as all Product Config settings.
|
|
822
672
|
*/
|
|
823
|
-
|
|
824
|
-
CleverTapReact.setUIEditorConnectionEnabled(enabled);
|
|
825
|
-
},
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* Sets default product config params using the given object.
|
|
829
|
-
* @param {object} productConfigMap - key-value product config properties. keys are strings and values can be string, double, integer, boolean or json in string format.
|
|
830
|
-
*/
|
|
831
|
-
setDefaultsMap: function(productConfigMap) {
|
|
832
|
-
CleverTapReact.setDefaultsMap(productConfigMap);
|
|
833
|
-
},
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* Starts fetching product configs, adhering to the default minimum fetch interval.
|
|
837
|
-
*/
|
|
838
|
-
fetch: function() {
|
|
839
|
-
CleverTapReact.fetch();
|
|
840
|
-
},
|
|
841
|
-
|
|
842
|
-
/**
|
|
843
|
-
* Starts fetching product configs, adhering to the specified minimum fetch interval in seconds.
|
|
844
|
-
* @param {int} intervalInSecs - minimum fetch interval in seconds.
|
|
845
|
-
*/
|
|
846
|
-
fetchWithMinimumIntervalInSeconds: function(intervalInSecs) {
|
|
847
|
-
CleverTapReact.fetchWithMinimumFetchIntervalInSeconds(intervalInSecs);
|
|
848
|
-
},
|
|
849
|
-
|
|
850
|
-
/**
|
|
851
|
-
* Activates the most recently fetched product configs, so that the fetched key value pairs take effect.
|
|
852
|
-
*/
|
|
853
|
-
activate: function() {
|
|
854
|
-
CleverTapReact.activate();
|
|
855
|
-
},
|
|
856
|
-
|
|
857
|
-
/**
|
|
858
|
-
* Asynchronously fetches and then activates the fetched product configs.
|
|
859
|
-
*/
|
|
860
|
-
fetchAndActivate: function() {
|
|
861
|
-
CleverTapReact.fetchAndActivate();
|
|
862
|
-
},
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* Sets the minimum interval in seconds between successive fetch calls.
|
|
866
|
-
* @param {int} intervalInSecs - interval in seconds between successive fetch calls.
|
|
867
|
-
*/
|
|
868
|
-
setMinimumFetchIntervalInSeconds: function(intervalInSecs) {
|
|
869
|
-
CleverTapReact.setMinimumFetchIntervalInSeconds(intervalInSecs);
|
|
870
|
-
},
|
|
871
|
-
|
|
872
|
-
/**
|
|
873
|
-
* Deletes all activated, fetched and defaults configs as well as all Product Config settings.
|
|
874
|
-
*/
|
|
875
|
-
resetProductConfig: function() {
|
|
673
|
+
resetProductConfig: function () {
|
|
876
674
|
CleverTapReact.reset();
|
|
877
675
|
},
|
|
878
676
|
|
|
@@ -881,7 +679,7 @@ var CleverTap = {
|
|
|
881
679
|
* @param {string} the property key
|
|
882
680
|
* @param {function(err, res)} callback that returns a value of type string if present else blank
|
|
883
681
|
*/
|
|
884
|
-
getProductConfigString: function(key, callback) {
|
|
682
|
+
getProductConfigString: function (key, callback) {
|
|
885
683
|
callWithCallback('getString', [key], callback);
|
|
886
684
|
},
|
|
887
685
|
|
|
@@ -890,7 +688,7 @@ var CleverTap = {
|
|
|
890
688
|
* @param {string} the property key
|
|
891
689
|
* @param {function(err, res)} callback that returns a value of type boolean if present else false
|
|
892
690
|
*/
|
|
893
|
-
getProductConfigBoolean: function(key, callback) {
|
|
691
|
+
getProductConfigBoolean: function (key, callback) {
|
|
894
692
|
callWithCallback('getBoolean', [key], callback);
|
|
895
693
|
},
|
|
896
694
|
|
|
@@ -899,15 +697,15 @@ var CleverTap = {
|
|
|
899
697
|
* @param {string} the property key
|
|
900
698
|
* @param {function(err, res)} callback that returns a value of type number if present else 0
|
|
901
699
|
*/
|
|
902
|
-
getNumber: function(key, callback) {
|
|
700
|
+
getNumber: function (key, callback) {
|
|
903
701
|
callWithCallback('getDouble', [key], callback);
|
|
904
702
|
},
|
|
905
703
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
getLastFetchTimeStampInMillis: function(callback) {
|
|
704
|
+
/**
|
|
705
|
+
* Returns the last fetched timestamp in millis.
|
|
706
|
+
* @param {function(err, res)} callback that returns value of timestamp in millis as a string.
|
|
707
|
+
*/
|
|
708
|
+
getLastFetchTimeStampInMillis: function (callback) {
|
|
911
709
|
callWithCallback('getLastFetchTimeStampInMillis', null, callback);
|
|
912
710
|
},
|
|
913
711
|
|
|
@@ -917,17 +715,72 @@ var CleverTap = {
|
|
|
917
715
|
* @param {string} default value of the key, in case we don't find any feature flag with the key.
|
|
918
716
|
* @param {function(err, res)} callback that returns a feature flag value of type boolean if present else provided default value
|
|
919
717
|
*/
|
|
920
|
-
getFeatureFlag: function(name,defaultValue,callback){
|
|
921
|
-
callWithCallback('getFeatureFlag', [name,defaultValue], callback);
|
|
718
|
+
getFeatureFlag: function (name, defaultValue, callback) {
|
|
719
|
+
callWithCallback('getFeatureFlag', [name, defaultValue], callback);
|
|
720
|
+
},
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Returns a unique identifier through callback by which CleverTap identifies this user
|
|
724
|
+
*
|
|
725
|
+
* @param {function(err, res)} non-null callback to retrieve identifier
|
|
726
|
+
*/
|
|
727
|
+
getCleverTapID: function (callback) {
|
|
728
|
+
callWithCallback('getCleverTapID', null, callback);
|
|
729
|
+
},
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Suspends display of InApp Notifications.
|
|
733
|
+
* The InApp Notifications are queued once this method is called
|
|
734
|
+
* and will be displayed once resumeInAppNotifications() is called.
|
|
735
|
+
*/
|
|
736
|
+
suspendInAppNotifications: function () {
|
|
737
|
+
CleverTapReact.suspendInAppNotifications();
|
|
738
|
+
},
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Suspends the display of InApp Notifications and discards any new InApp Notifications to be shown
|
|
742
|
+
* after this method is called.
|
|
743
|
+
* The InApp Notifications will be displayed only once resumeInAppNotifications() is called.
|
|
744
|
+
*/
|
|
745
|
+
discardInAppNotifications: function () {
|
|
746
|
+
CleverTapReact.discardInAppNotifications();
|
|
747
|
+
},
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Resumes display of InApp Notifications.
|
|
751
|
+
*
|
|
752
|
+
* If suspendInAppNotifications() was called previously, calling this method will instantly show
|
|
753
|
+
* all queued InApp Notifications and also resume InApp Notifications on events raised after this
|
|
754
|
+
* method is called.
|
|
755
|
+
*
|
|
756
|
+
* If discardInAppNotifications() was called previously, calling this method will only resume
|
|
757
|
+
* InApp Notifications on events raised after this method is called.
|
|
758
|
+
*/
|
|
759
|
+
resumeInAppNotifications: function () {
|
|
760
|
+
CleverTapReact.resumeInAppNotifications();
|
|
922
761
|
},
|
|
923
762
|
|
|
924
763
|
/**
|
|
925
764
|
* Set the SDK debug level
|
|
926
765
|
* @param {int} 0 = off, 1 = on
|
|
927
766
|
*/
|
|
928
|
-
setDebugLevel: function(level) {
|
|
767
|
+
setDebugLevel: function (level) {
|
|
929
768
|
CleverTapReact.setDebugLevel(level);
|
|
930
769
|
}
|
|
931
770
|
};
|
|
932
771
|
|
|
772
|
+
function convertDateToEpochInProperties(map) {
|
|
773
|
+
/**
|
|
774
|
+
* Conversion of date object in suitable CleverTap format(Epoch)
|
|
775
|
+
*/
|
|
776
|
+
if (map) {
|
|
777
|
+
for (let [key, value] of Object.entries(map)) {
|
|
778
|
+
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
779
|
+
map[key] = "$D_" + Math.floor(value.getTime() / 1000);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
};
|
|
785
|
+
|
|
933
786
|
module.exports = CleverTap;
|