clevertap-react-native 0.5.1 → 0.8.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.
Files changed (64) hide show
  1. package/.codebeatignore +1 -1
  2. package/CHANGELOG.md +21 -0
  3. package/LICENSE +2 -2
  4. package/README.md +5 -3
  5. package/android/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/6.1.1/fileHashes/fileHashes.bin +0 -0
  7. package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  8. package/android/.gradle/6.1.1/gc.properties +0 -0
  9. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  10. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  11. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  12. package/android/.gradle/checksums/checksums.lock +0 -0
  13. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  14. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  15. package/android/.gradle/vcs-1/gc.properties +0 -0
  16. package/android/android.iml +120 -0
  17. package/android/build/generated/source/buildConfig/debug/com/clevertap/react/BuildConfig.java +12 -0
  18. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +14 -0
  19. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output.json +27 -0
  20. package/android/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
  21. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  22. package/android/build/intermediates/annotations_typedef_file/debug/typedefs.txt +0 -0
  23. package/android/build/intermediates/compile_only_not_namespaced_r_class_jar/debug/R.jar +0 -0
  24. package/android/build/intermediates/compile_symbol_list/debug/R.txt +4287 -0
  25. package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  26. package/android/build/intermediates/incremental/debug-mergeNativeLibs/merge-state +0 -0
  27. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  28. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  29. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  30. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -0
  31. package/android/build/intermediates/incremental/packageDebugResources/merger.xml +2 -0
  32. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/BuildConfig.class +0 -0
  33. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$1.class +0 -0
  34. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$ErrorMessages.class +0 -0
  35. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule$InBoxMessages.class +0 -0
  36. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapModule.class +0 -0
  37. package/android/build/intermediates/javac/debug/classes/com/clevertap/react/CleverTapPackage.class +0 -0
  38. package/android/build/intermediates/library_manifest/debug/AndroidManifest.xml +14 -0
  39. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
  40. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +17 -0
  41. package/android/build/intermediates/merged_java_res/debug/out.jar +0 -0
  42. package/android/build/intermediates/merged_manifests/debug/output.json +27 -0
  43. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +3208 -0
  44. package/android/build/outputs/aar/android-debug.aar +0 -0
  45. package/android/build/outputs/logs/manifest-merger-debug-report.txt +39 -0
  46. package/android/build.gradle +7 -6
  47. package/android/clevertap-react-native.iml +253 -0
  48. package/android/local.properties +8 -0
  49. package/android/src/main/java/com/clevertap/react/CleverTapModule.java +65 -3
  50. package/android/src/main/java/com/clevertap/react/CleverTapPackage.java +1 -1
  51. package/clevertap-react-native.podspec +1 -1
  52. package/docs/install.md +13 -28
  53. package/docs/integration.md +2 -3
  54. package/docs/usage.md +368 -11
  55. package/index.d.ts +60 -0
  56. package/index.js +64 -1
  57. package/ios/CleverTapReact/CleverTapReact.m +33 -0
  58. package/ios/CleverTapReact/CleverTapSDK.framework.zip +0 -0
  59. package/package.json +1 -1
  60. package/ios/CleverTapReact.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  61. package/ios/CleverTapReact.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  62. package/ios/CleverTapReact.xcodeproj/project.xcworkspace/xcuserdata/aditi.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  63. package/ios/CleverTapReact.xcodeproj/xcuserdata/aditi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  64. package/ios/CleverTapReact.xcodeproj/xcuserdata/aditi.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/docs/usage.md CHANGED
@@ -1,40 +1,397 @@
1
1
 
2
- ## Example JS Usage
2
+ ## Example Usage
3
+
3
4
  #### Grab a reference
4
5
  ```javascript
5
6
  const CleverTap = require('clevertap-react-native');
6
7
  ```
7
8
 
9
+ ## User Profiles
10
+
11
+ #### Update User Profile(Push Profile)
12
+
13
+ ```javascript
14
+ CleverTap.profileSet({"Identity":11102008, "Name":"React-Test Profile","Email":"r@gmail.com","Gender":"Male","DOB":"1995-10-14", "custom":1.73});
15
+ ```
16
+
17
+ #### Set Multi Values For Key
18
+
19
+ ```javascript
20
+ CleverTap.profileSetMultiValuesForKey(['a', 'b', 'c'], 'letters');
21
+ ```
22
+
23
+ #### Remove Multi Value For Key
24
+
25
+ ```javascript
26
+ CleverTap.profileRemoveMultiValueForKey('b', 'letters');
27
+ ```
28
+
29
+ #### Add Multi Value For Key
30
+
31
+ ```javascript
32
+ CleverTap.profileAddMultiValueForKey('d', 'letters');
33
+ ```
34
+
35
+ #### Create a User profile when user logs in (On User Login)
36
+
37
+ ```javascript
38
+ CleverTap.onUserLogin({'Name': 'React-Test', 'Identity': '11102008', 'Email': 'r@gmail.com', 'custom1': 43});
39
+ ```
40
+
41
+ #### Get CleverTap Reference id
42
+
43
+ ```javascript
44
+ CleverTap.profileGetCleverTapID((err, res) => {
45
+ console.log('CleverTapID', res, err);
46
+ });
47
+ ```
48
+
49
+ #### Set Location to User Profile
50
+
51
+ ```javascript
52
+ CleverTap.setLocation(34.15, -118.20);
53
+ ```
54
+
55
+ #### Increment a User Profile property
56
+
57
+ ```javascript
58
+ CleverTap.profileIncrementValueForKey(1, "score");
59
+ ```
60
+
61
+ #### Decrement a User Profile property
62
+
63
+ ```javascript
64
+ CleverTap.profileDecrementValueForKey(1, "score");
65
+ ```
66
+
67
+ -----------
68
+
69
+ ## User Events
70
+
8
71
  #### Record an event
72
+
9
73
  ```javascript
10
74
  CleverTap.recordEvent('testEvent');
11
75
  ```
12
76
 
13
77
  #### Record Charged event
78
+
14
79
  ```javascript
15
80
  CleverTap.recordChargedEvent({'totalValue': 20, 'category': 'books'}, [{'title': 'book1'}, {'title': 'book2'}, {'title': 'book3'}]);
16
81
  ```
17
82
 
18
- #### Update a user profile
19
- ```javascript
20
- CleverTap.onUserLogin({'Name': 'testUserA1', 'Identity': '123456', 'Email': 'test@test.com', 'custom1': 123});
21
- ```
83
+ -----------
22
84
 
23
- #### App Inbox
85
+ ## App Inbox
86
+
87
+ #### Initialize the CleverTap App Inbox Method
24
88
 
25
- ##### Initialize the CleverTap App Inbox Method
26
89
  ```javascript
27
90
  CleverTap.initializeInbox();
28
91
  ```
29
92
 
30
- ##### Show the App Inbox
93
+ #### Show the App Inbox
94
+
31
95
  ```javascript
32
96
  CleverTap.showInbox({'tabs':['Offers','Promotions'],'navBarTitle':'My App Inbox','navBarTitleColor':'#FF0000','navBarColor':'#FFFFFF','inboxBackgroundColor':'#AED6F1','backButtonColor':'#00FF00'
33
97
  ,'unselectedTabColor':'#0000FF','selectedTabColor':'#FF0000','selectedTabIndicatorColor':'#000000',
34
98
  'noMessageText':'No message(s)','noMessageTextColor':'#FF0000'});
35
99
  ```
36
100
 
101
+ #### Get Total message count
102
+
103
+ ```javascript
104
+ CleverTap.getInboxMessageCount((err, res) => {
105
+ console.log('Total Messages: ', res, err);
106
+ });
107
+ ```
108
+
109
+ #### Get Total message count
110
+
111
+ ```javascript
112
+ CleverTap.getInboxMessageUnreadCount((err, res) => {
113
+ console.log('Unread Messages: ', res, err);
114
+ });
115
+ ```
116
+
117
+ #### Get All Inbox Messages
118
+
119
+ ```javascript
120
+ CleverTap.getAllInboxMessages((err, res) => {
121
+ console.log('All Inbox Messages: ', res, err);
122
+ });
123
+ ```
124
+
125
+ #### Get all Inbox unread messages
126
+
127
+ ```javascript
128
+ CleverTap.getUnreadInboxMessages((err, res) => {
129
+ console.log('Unread Inbox Messages: ', res, err);
130
+ });
131
+ ```
132
+
133
+ #### Get inbox Id
134
+
135
+ ```javascript
136
+ CleverTap.getInboxMessageForId('Message Id',(err, res) => {
137
+ console.log("marking message read = "+res);
138
+ });
139
+ ```
140
+
141
+ #### Delete message with id
142
+
143
+ ```javascript
144
+ CleverTap.deleteInboxMessageForId('Message Id');
145
+ ```
146
+
147
+ #### Mark a message as Read for inbox Id
148
+
149
+ ```javascript
150
+ CleverTap.markReadInboxMessageForId('Message Id');
151
+ ```
152
+
153
+ #### pushInbox Notification Viewed Event For Id
154
+
155
+ ```javascript
156
+ CleverTap.pushInboxNotificationViewedEventForId('Message Id');
157
+ ```
158
+
159
+ #### push Inbox Notification Clicked Event For Id
160
+
161
+ ```javascript
162
+ CleverTap.pushInboxNotificationClickedEventForId('Message Id');
163
+ ```
164
+
165
+ -----------
166
+
167
+ ## Push Notifications
168
+
169
+ #### Creating Notification Channel
170
+
171
+ ```javascript
172
+ CleverTap.createNotificationChannel("CtRNS", "Clever Tap React Native Testing", "CT React Native Testing", 1, true);
173
+ ```
174
+
175
+ #### Delete Notification Channel
176
+
177
+ ```javascript
178
+ CleverTap.deleteNotificationChannel("RNTesting");
179
+ ```
180
+
181
+ #### Creating a group notification channel
182
+
183
+ ```javascript
184
+ CleverTap.createNotificationChannelGroup(String groupId, String groupName);
185
+ ```
186
+
187
+ #### Delete a group notification channel
188
+
189
+ ```javascript
190
+ CleverTap.deleteNotificationChannelGroup(String groupId);
191
+ ```
192
+
193
+ #### Registering Fcm Token
194
+
195
+ ```javascript
196
+ CleverTap.setPushToken("<Replace with FCM Token value>", CleverTap.FCM);
197
+ ```
198
+
199
+ -----------
200
+
201
+ ## Native Display
202
+
203
+ #### Get Display Unit for Id
204
+
205
+ ```javascript
206
+ CleverTap.getDisplayUnitForId('Unit Id', (err, res) => {
207
+ console.log('Get Display Unit for Id:', res, err);
208
+ });
209
+ ```
210
+
211
+ #### Get All Display Units
212
+
213
+ ```javascript
214
+ CleverTap.getAllDisplayUnits((err, res) => {
215
+ console.log('All Display Units: ', res, err);
216
+ });
217
+ ```
218
+
219
+ -----------
220
+
221
+ ## Product Config
222
+
223
+ #### Set Product Configuration to default
224
+
225
+ ```javascript
226
+ CleverTap.setDefaultsMap({'text_color': 'red', 'msg_count': 100, 'price': 100.50, 'is_shown': true, 'json': '{"key":"val"}'});
227
+ ```
228
+
229
+ #### Fetching product configs
230
+
231
+ ```javascript
232
+ CleverTap.fetch();
233
+ ```
234
+
235
+ #### Activate the most recently fetched product config
236
+
237
+ ```javascript
238
+ CleverTap.activate();
239
+ ```
240
+
241
+ #### Fetch And Activate product config
242
+
243
+ ```javascript
244
+ CleverTap.fetchAndActivate();
245
+ ```
246
+
247
+ #### Fetch Minimum Time Interval
248
+
249
+ ```javascript
250
+ CleverTap.fetchWithMinimumIntervalInSeconds(60);
251
+ ```
252
+
253
+ #### Set Minimum Time Interval for Fetch
254
+
255
+ ```javascript
256
+ CleverTap.setMinimumFetchIntervalInSeconds(60);
257
+ ```
258
+
259
+ #### Get Boolean key
260
+
261
+ ```javascript
262
+ CleverTap.getProductConfigBoolean('is_shown', (err, res) => {
263
+ console.log('PC is_shown val in boolean :', res, err);
264
+ });
265
+ ```
266
+ #### Get Long
267
+
268
+ ```javascript
269
+ CleverTap.getNumber('msg_count', (err, res) => {
270
+ console.log('PC is_shown val in number(long) :', res, err);
271
+ });
272
+ ```
273
+ #### Get Double
274
+
275
+ ```javascript
276
+ CleverTap.getNumber('price', (err, res) => {
277
+ console.log('PC price val in number :', res, err);
278
+ });
279
+ ```
280
+ #### Get String
281
+
282
+ ```javascript
283
+ CleverTap.getProductConfigString('text_color', (err, res) => {
284
+ console.log('PC text_color val in string :', res, err);
285
+ });
286
+ ```
287
+ #### Get String (JSON)
288
+
289
+ ```javascript
290
+ CleverTap.getProductConfigString('json', (err, res) => {
291
+ console.log('PC json val in string :', res, err);
292
+ });
293
+ ```
294
+
295
+ #### Delete all activated, fetched and defaults configs
296
+
297
+ ```javascript
298
+ CleverTap.resetProductConfig();
299
+ ```
300
+
301
+ #### Get last fetched timestamp in millis
302
+
303
+ ```javascript
304
+ CleverTap.getLastFetchTimeStampInMillis((err, res) => {
305
+ console.log('LastFetchTimeStampInMillis in string: ', res, err);
306
+ });
307
+ ```
308
+
309
+ ## Feature Flag
310
+
311
+ #### Get Feature Flag
312
+
313
+ ```javascript
314
+ CleverTap.getFeatureFlag('is_dark_mode', false, (err, res) => {
315
+ console.log('FF is_dark_mode val in boolean :', res, err);
316
+ });
317
+ ```
318
+
319
+ ## CleverTap ID
320
+
321
+ #### Get CleverTap ID
322
+
323
+ ```javascript
324
+ CleverTap.getCleverTapID((err, res) => {
325
+ console.log('CleverTapID', res, err);
326
+ });
327
+ ```
328
+
329
+ -----------
330
+
331
+ ## App Personalisation
332
+
333
+ #### Enable Personalization
334
+
335
+ ```javascript
336
+ CleverTap.enablePersonalization();
337
+ ```
338
+
339
+ #### Disable Personalization
340
+
341
+ ```javascript
342
+ CleverTap.disablePersonalization();
343
+ ```
344
+
345
+ #### Get Profile Name
346
+
347
+ ```javascript
348
+ CleverTap.profileGetProperty('Name', (err, res) => {
349
+ console.log('CleverTap Profile Name: ', res, err);
350
+ });
351
+ ```
352
+
353
+ -----------
354
+
355
+ ## Debugging
356
+
357
+ ```javascript
358
+ CleverTap.setDebugLevel(3);
359
+ ```
360
+
361
+ ## Attributions
362
+
363
+ #### Get CleverTap Attribution Identifier
364
+
365
+ ```javascript
366
+ CleverTap.profileGetCleverTapAttributionIdentifier((err, res) => {
367
+ console.log('CleverTapAttributionIdentifier', res, err);
368
+ });
369
+ ```
370
+
371
+ -----------
372
+
373
+ ## InApp Notification Controls
374
+
375
+ #### Suspend InApp Notifications
376
+
377
+ ```javascript
378
+ CleverTap.suspendInAppNotifications();
379
+ ```
380
+
381
+ #### Discard InApp Notifications
382
+
383
+ ```javascript
384
+ CleverTap.discardInAppNotifications();
385
+ ```
386
+
387
+ #### Resume InApp Notifications
388
+
389
+ ```javascript
390
+ CleverTap.resumeInAppNotifications();
391
+ ```
392
+
393
+
37
394
  ### For more information,
38
- - [see included Starter Application](https://github.com/CleverTap/clevertap-react-native/blob/master/Starter/App.js)
39
- - [see CleverTap JS interface](https://github.com/CleverTap/clevertap-react-native/blob/master/index.js)
40
- - [see CleverTap TS interface](https://github.com/CleverTap/clevertap-react-native/blob/master/index.d.ts)
395
+ - [See included Example Application](/Example/App.js)
396
+ - [See CleverTap JS interface](/index.js)
397
+ - [See CleverTap TS interface](/index.d.ts)
package/index.d.ts CHANGED
@@ -274,17 +274,26 @@
274
274
  export function profileGetProperty(propertyName: string, callback: Callback): void;
275
275
 
276
276
  /**
277
+ * Deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
277
278
  * Get a unique CleverTap identifier suitable for use with install attribution providers.
278
279
  * calls back with unique CleverTap attribution identifier
279
280
  */
280
281
  export function profileGetCleverTapAttributionIdentifier(callback: Callback): void;
281
282
 
282
283
  /**
284
+ * Deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
283
285
  * Get User Profile CleverTapID
284
286
  * calls back with CleverTapID or false
285
287
  */
286
288
  export function profileGetCleverTapID(callback: Callback): void;
287
289
 
290
+ /**
291
+ * Returns a unique identifier through callback by which CleverTap identifies this user
292
+ *
293
+ * @param {function(err, res)} non-null callback to retrieve identifier
294
+ */
295
+ export function getCleverTapID(callback: Callback): void;
296
+
288
297
  /**
289
298
  * Remove the property specified by key from the user profile
290
299
  * @param key {string}
@@ -325,6 +334,26 @@
325
334
  */
326
335
  export function profileRemoveMultiValuesForKey(values: any, key: string): void;
327
336
 
337
+ /*******************************
338
+ * Increment/Decrement Operators
339
+ *******************************/
340
+
341
+ /**
342
+ * This method is used to increment the given value
343
+ *
344
+ * @param value {Number} can be int,double or float only (NaN,Infinity etc not supported)
345
+ * @param key {string} profile property
346
+ */
347
+ export function profileIncrementValueForKey(value:number, key:string): void;
348
+
349
+ /**
350
+ * This method is used to decrement the given value
351
+ *
352
+ * @param value {Number} can be int,double or float only (NaN,Infinity etc not supported)
353
+ * @param key {string} profile property
354
+ */
355
+ export function profileDecrementValueForKey(value:number, key:string): void;
356
+
328
357
  /*******************
329
358
  * Session
330
359
  ******************/
@@ -543,6 +572,37 @@
543
572
  defaultValue: boolean,
544
573
  callback: Callback): void;
545
574
 
575
+
576
+ /*******************
577
+ * InApp Controls
578
+ ******************/
579
+
580
+ /**
581
+ * Suspends display of InApp Notifications.
582
+ * The InApp Notifications are queued once this method is called
583
+ * and will be displayed once resumeInAppNotifications() is called.
584
+ */
585
+ export function suspendInAppNotifications(): void;
586
+
587
+ /**
588
+ * Suspends the display of InApp Notifications and discards any new InApp Notifications to be shown
589
+ * after this method is called.
590
+ * The InApp Notifications will be displayed only once resumeInAppNotifications() is called.
591
+ */
592
+ export function discardInAppNotifications(): void;
593
+
594
+ /**
595
+ * Resumes display of InApp Notifications.
596
+ *
597
+ * If suspendInAppNotifications() was called previously, calling this method will instantly show
598
+ * all queued InApp Notifications and also resume InApp Notifications on events raised after this
599
+ * method is called.
600
+ *
601
+ * If discardInAppNotifications() was called previously, calling this method will only resume
602
+ * InApp Notifications on events raised after this method is called.
603
+ */
604
+ export function resumeInAppNotifications(): void;
605
+
546
606
  /*******************
547
607
  * Developer Options
548
608
  ******************/
package/index.js CHANGED
@@ -78,7 +78,7 @@ var CleverTap = {
78
78
  },
79
79
 
80
80
  /**
81
- * Deprecated - Since version 5.0.0. Use removeListener(eventName) instead
81
+ * Deprecated - Since version 0.5.0. Use removeListener(eventName) instead
82
82
  * Remove all event listeners
83
83
  */
84
84
  removeListeners: function () {
@@ -323,6 +323,7 @@ var CleverTap = {
323
323
  },
324
324
 
325
325
  /**
326
+ * Deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
326
327
  * Get a unique CleverTap identifier suitable for use with install attribution providers
327
328
  * @param {function(err, res)} callback that returns a string res
328
329
  */
@@ -331,6 +332,7 @@ var CleverTap = {
331
332
  },
332
333
 
333
334
  /**
335
+ * Deprecated - Since version 0.6.0. Use getCleverTapID(callback) instead
334
336
  * Get the user profile's CleverTap identifier value
335
337
  * @param {function(err, res)} callback that returns a string res
336
338
  */
@@ -429,6 +431,26 @@ var CleverTap = {
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
@@ -697,6 +719,47 @@ var CleverTap = {
697
719
  callWithCallback('getFeatureFlag', [name, defaultValue], callback);
698
720
  },
699
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();
761
+ },
762
+
700
763
  /**
701
764
  * Set the SDK debug level
702
765
  * @param {int} 0 = off, 1 = on
@@ -13,6 +13,7 @@
13
13
  #import "CleverTap+DisplayUnit.h"
14
14
  #import "CleverTap+FeatureFlags.h"
15
15
  #import "CleverTap+ProductConfig.h"
16
+ #import "CleverTap+InAppNotifications.h"
16
17
 
17
18
  static NSDateFormatter *dateFormatter;
18
19
 
@@ -200,6 +201,12 @@ RCT_EXPORT_METHOD(profileGetCleverTapID:(RCTResponseSenderBlock)callback) {
200
201
  [self returnResult:result withCallback:callback andError:nil];
201
202
  }
202
203
 
204
+ RCT_EXPORT_METHOD(getCleverTapID:(RCTResponseSenderBlock)callback) {
205
+ RCTLogInfo(@"[CleverTap getCleverTapID]");
206
+ NSString *result = [[CleverTap sharedInstance] profileGetCleverTapID];
207
+ [self returnResult:result withCallback:callback andError:nil];
208
+ }
209
+
203
210
  RCT_EXPORT_METHOD(onUserLogin:(NSDictionary*)profile) {
204
211
  RCTLogInfo(@"[CleverTap onUserLogin: %@]", profile);
205
212
  NSDictionary *_profile = [self formatProfile:profile];
@@ -248,6 +255,15 @@ RCT_EXPORT_METHOD(profileRemoveMultiValues:(NSArray<NSString*>*)values forKey:(N
248
255
  [[CleverTap sharedInstance] profileRemoveMultiValues:values forKey:key];
249
256
  }
250
257
 
258
+ RCT_EXPORT_METHOD(profileIncrementValueForKey:(NSNumber* _Nonnull)value forKey:(NSString* _Nonnull)key) {
259
+ RCTLogInfo(@"[CleverTap profileIncrementValueBy: %@ forKey: %@]", value, key);
260
+ [[CleverTap sharedInstance] profileIncrementValueBy:value forKey:key];
261
+ }
262
+
263
+ RCT_EXPORT_METHOD(profileDecrementValueForKey:(NSNumber* _Nonnull)value forKey:(NSString* _Nonnull)key) {
264
+ RCTLogInfo(@"[CleverTap profileDecrementValueBy: %@ forKey: %@]", value, key);
265
+ [[CleverTap sharedInstance] profileDecrementValueBy:value forKey:key];
266
+ }
251
267
 
252
268
  #pragma mark - Session API
253
269
 
@@ -686,4 +702,21 @@ RCT_EXPORT_METHOD(reset) {
686
702
  [[[CleverTap sharedInstance] productConfig] reset];
687
703
  }
688
704
 
705
+ #pragma mark - InApp Notification Controls
706
+
707
+ RCT_EXPORT_METHOD(suspendInAppNotifications) {
708
+ RCTLogInfo(@"[CleverTap suspendInAppNotifications");
709
+ [[CleverTap sharedInstance] suspendInAppNotifications];
710
+ }
711
+
712
+ RCT_EXPORT_METHOD(discardInAppNotifications) {
713
+ RCTLogInfo(@"[CleverTap discardInAppNotifications");
714
+ [[CleverTap sharedInstance] discardInAppNotifications];
715
+ }
716
+
717
+ RCT_EXPORT_METHOD(resumeInAppNotifications) {
718
+ RCTLogInfo(@"[CleverTap resumeInAppNotifications");
719
+ [[CleverTap sharedInstance] resumeInAppNotifications];
720
+ }
721
+
689
722
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clevertap-react-native",
3
- "version": "0.5.1",
3
+ "version": "0.8.0",
4
4
  "description": "CleverTap React Native SDK.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- <FileRef
5
- location = "self:">
6
- </FileRef>
7
- </Workspace>
@@ -1,8 +0,0 @@
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>IDEDidComputeMac32BitWarning</key>
6
- <true/>
7
- </dict>
8
- </plist>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Bucket
3
- uuid = "1BD6870F-EA57-44A4-9956-6DD1E1A08361"
4
- type = "1"
5
- version = "2.0">
6
- </Bucket>