react-native-notifyvisitors 4.2.4 → 4.3.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 (59) hide show
  1. package/android/.settings/org.eclipse.buildship.core.prefs +3 -3
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/rn_notifyvisitors/RNNotifyvisitorsModule.java +47 -8
  4. package/index.d.ts +1 -0
  5. package/index.js +379 -361
  6. package/ios/RNNotifyvisitors/RCTNVEventEmitter.m +69 -9
  7. package/ios/RNNotifyvisitors/RNNotifyvisitors.h +28 -17
  8. package/ios/RNNotifyvisitors/RNNotifyvisitors.m +116 -56
  9. package/ios/RNNotifyvisitors.xcodeproj/project.pbxproj +5 -37
  10. package/ios/notifyvisitors.xcframework/Info.plist +40 -0
  11. package/ios/notifyvisitors.xcframework/ios-arm64/notifyvisitors.framework/Assets.car +0 -0
  12. package/ios/notifyvisitors.xcframework/ios-arm64/notifyvisitors.framework/Headers/notifyvisitors.h +148 -0
  13. package/ios/notifyvisitors.xcframework/ios-arm64/notifyvisitors.framework/Info.plist +0 -0
  14. package/ios/notifyvisitors.xcframework/ios-arm64/notifyvisitors.framework/Modules/module.modulemap +6 -0
  15. package/ios/notifyvisitors.xcframework/ios-arm64/notifyvisitors.framework/_CodeSignature/CodeResources +135 -0
  16. package/ios/notifyvisitors.xcframework/ios-arm64/notifyvisitors.framework/notifyvisitors +0 -0
  17. package/ios/notifyvisitors.xcframework/ios-arm64_x86_64-simulator/notifyvisitors.framework/Assets.car +0 -0
  18. package/ios/notifyvisitors.xcframework/ios-arm64_x86_64-simulator/notifyvisitors.framework/Headers/notifyvisitors.h +148 -0
  19. package/ios/notifyvisitors.xcframework/ios-arm64_x86_64-simulator/notifyvisitors.framework/Info.plist +0 -0
  20. package/ios/notifyvisitors.xcframework/ios-arm64_x86_64-simulator/notifyvisitors.framework/Modules/module.modulemap +6 -0
  21. package/ios/notifyvisitors.xcframework/ios-arm64_x86_64-simulator/notifyvisitors.framework/_CodeSignature/CodeResources +135 -0
  22. package/ios/notifyvisitors.xcframework/ios-arm64_x86_64-simulator/notifyvisitors.framework/notifyvisitors +0 -0
  23. package/ios/{Assets/nvResourceValues.plist → nvResourceValues.plist} +7 -3
  24. package/package.json +1 -1
  25. package/react-native-notifyvisitors.podspec +1 -1
  26. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  27. package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  28. package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
  29. package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
  30. package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
  31. package/android/.gradle/7.4.2/gc.properties +0 -0
  32. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  33. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  34. package/android/.gradle/checksums/checksums.lock +0 -0
  35. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  36. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  37. package/android/.gradle/vcs-1/gc.properties +0 -0
  38. package/ios/Assets/empty.png +0 -0
  39. package/ios/Assets/nv_NotificationCenterBg.png +0 -0
  40. package/ios/Assets/nv_NotificationCenterBg@2x.png +0 -0
  41. package/ios/Assets/nv_NotificationCenterBg@3x.png +0 -0
  42. package/ios/Assets/nv_deleteIcon.png +0 -0
  43. package/ios/Assets/nv_deleteIcon@2x.png +0 -0
  44. package/ios/Assets/pause.png +0 -0
  45. package/ios/Assets/play.png +0 -0
  46. package/ios/Assets/slider_bar.png +0 -0
  47. package/ios/Assets/slider_barHead.png +0 -0
  48. package/ios/RNNotifyvisitors.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
  49. package/ios/RNNotifyvisitors.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  50. package/ios/RNNotifyvisitors.xcodeproj/project.xcworkspace/xcuserdata/neeraj.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  51. package/ios/RNNotifyvisitors.xcodeproj/project.xcworkspace/xcuserdata/nv_macbook-2.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  52. package/ios/RNNotifyvisitors.xcodeproj/project.xcworkspace/xcuserdata/siddharthgupta.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  53. package/ios/RNNotifyvisitors.xcodeproj/project.xcworkspace/xcuserdata/tagnpinwebsolutionsllp.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  54. package/ios/RNNotifyvisitors.xcodeproj/xcuserdata/neeraj.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  55. package/ios/RNNotifyvisitors.xcodeproj/xcuserdata/nv_macbook-2.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  56. package/ios/RNNotifyvisitors.xcodeproj/xcuserdata/siddharthgupta.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  57. package/ios/RNNotifyvisitors.xcodeproj/xcuserdata/tagnpinwebsolutionsllp.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  58. package/ios/libnotifyvisitors_6_4_4.a +0 -0
  59. package/ios/notifyvisitors.h +0 -137
package/index.js CHANGED
@@ -1,380 +1,398 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- import { NativeModules, NativeEventEmitter, Platform } from 'react-native';
3
+ import { NativeModules, NativeEventEmitter, Platform } from "react-native";
4
4
 
5
5
  const { RNNotifyvisitors } = NativeModules;
6
6
  const nvEventEmitter = new NativeEventEmitter(RNNotifyvisitors);
7
7
 
8
8
  const NV_CALLBACKS = {
9
- GET_LINK_INFO: "nv_push_banner_click",
10
- NV_CHAT_BOT_EVENT: "nv_chat_bot_button_click",
11
- NV_SHOW: "nv_show_callback",
12
- NV_EVENT: "nv_event_callback",
13
- NV_EVENT_SURVEY: "nv_common_show_event_callback"
14
- }
9
+ GET_LINK_INFO: "nv_push_banner_click",
10
+ NV_CHAT_BOT_EVENT: "nv_chat_bot_button_click",
11
+ NV_SHOW: "nv_show_callback",
12
+ NV_EVENT: "nv_event_callback",
13
+ NV_EVENT_SURVEY: "nv_common_show_event_callback",
14
+ };
15
15
 
16
16
  const CALLBACKS_STACK = {};
17
17
 
18
18
  const addListeners = function () {
19
- if (!(RNNotifyvisitors != null)) {
20
- return;
21
- }
22
- Object.keys(NV_CALLBACKS).forEach(val => {
23
- nvEventEmitter.addListener(NV_CALLBACKS[val], (data) => {
24
- try {
25
- if (data != null && typeof CALLBACKS_STACK[NV_CALLBACKS[val]] == "function") {
26
- if (Platform.OS == "ios") {
27
- CALLBACKS_STACK[NV_CALLBACKS[val]](data.data);
28
- } else {
29
- CALLBACKS_STACK[NV_CALLBACKS[val]](data);
30
- }
31
- }
32
- } catch (e) {
33
- console.log(e);
34
- }
35
- })
36
- })
37
- }
19
+ if (!(RNNotifyvisitors != null)) {
20
+ return;
21
+ }
22
+ Object.keys(NV_CALLBACKS).forEach((val) => {
23
+ nvEventEmitter.addListener(NV_CALLBACKS[val], (data) => {
24
+ try {
25
+ if (
26
+ data != null &&
27
+ typeof CALLBACKS_STACK[NV_CALLBACKS[val]] == "function"
28
+ ) {
29
+ if (Platform.OS == "ios") {
30
+ CALLBACKS_STACK[NV_CALLBACKS[val]](data.data);
31
+ } else {
32
+ CALLBACKS_STACK[NV_CALLBACKS[val]](data);
33
+ }
34
+ }
35
+ } catch (e) {
36
+ console.log(e);
37
+ }
38
+ });
39
+ });
40
+ };
38
41
 
39
42
  addListeners();
40
43
 
41
-
42
44
  /* Native SDK Bridge Class */
43
45
  export default class Notifyvisitors {
44
-
45
- /* 1 - Survery, InApp Banners */
46
- static show(tokens, customObjects, fragmentName, nvCallback) {
47
- console.log("NV- Show !!");
48
- try {
49
- CALLBACKS_STACK[NV_CALLBACKS.NV_SHOW] = nvCallback;
50
- RNNotifyvisitors.show(tokens, customObjects, fragmentName, nvCallback);
51
- } catch (e) {
52
- console.log(e);
53
- }
54
- }
55
-
56
- /* 2 - Notification Center */
57
- static showNotifications(mAppInboxInfo, dismissValue) {
58
- console.log("NV- Show Notifications !!");
59
- try {
60
- if (Platform.OS == "ios") {
61
- dismissValue = dismissValue + "";
62
- } else {
63
- dismissValue = parseInt(dismissValue);
64
- }
65
- RNNotifyvisitors.showNotifications(mAppInboxInfo, dismissValue);
66
- } catch (e) {
67
- console.log(e);
68
- }
69
-
70
- }
71
-
72
-
73
- /* 3 - Event Tracking */
74
- static event(eventName, attributes, ltv, scope, nvCallback) {
75
- console.log("NV- Events !!");
76
- try {
77
- CALLBACKS_STACK[NV_CALLBACKS.NV_EVENT] = nvCallback;
78
- RNNotifyvisitors.event(eventName, attributes, ltv, scope, nvCallback);
79
- } catch (e) {
80
- console.log(e);
81
- }
82
-
83
- }
84
-
85
- /* 4 - Login User */
86
- static userIdentifier(userID, sJsonObject) {
87
- console.log("NV- User Identifier !!");
88
- try {
89
- RNNotifyvisitors.userIdentifier(userID, sJsonObject);
90
- } catch (e) {
91
- console.log(e);
92
- }
93
-
94
- }
95
-
96
-
97
- /* 5 - chatbot */
98
- static startChatBot(screenName, nvCallback) {
99
- console.log("NV- Chatbot !!");
100
- try {
101
- CALLBACKS_STACK[NV_CALLBACKS.NV_CHAT_BOT_EVENT] = nvCallback;
102
- RNNotifyvisitors.startChatBot(screenName);
103
- } catch (e) {
104
- console.log(e)
105
- }
106
- }
107
-
108
- /* 6 - Push Notification Channel */
109
- static createNotificationChannel(chId, chName, chDescription, chImportance,
110
- enableLights, shouldVibrate, lightColor, soundFileName) {
111
- console.log("NV- Create Notification Channnel !!");
112
- try {
113
- if (Platform.OS === 'ios') {
114
- console.log("This function is not supported on IOS");
115
- } else {
116
- RNNotifyvisitors.createNotificationChannel(chId, chName,
117
- chDescription, chImportance, enableLights, shouldVibrate, lightColor, soundFileName);
118
- }
119
- } catch (e) {
120
- console.log(e);
121
- }
122
- }
123
-
124
- /* 7 - Push Notification Channel */
125
- static deleteNotificationChannel(channelId) {
126
- console.log("NV- Delate Notification Channnel !!");
127
- try {
128
- if (Platform.OS === 'ios') {
129
- console.log("This function is not supported on IOS");
130
- } else {
131
- RNNotifyvisitors.deleteNotificationChannel(channelId);
132
- }
133
- } catch (e) {
134
- console.log(e);
135
- }
136
- }
137
-
138
- /* 8 - Push Notification Channel Group */
139
- static createNotificationChannelGroup(groupId, groupName) {
140
- console.log("NV- Create Notification Channnel Group !!");
141
- try {
142
- if (Platform.OS === 'ios') {
143
- console.log("This function is not supported on IOS");
144
- } else {
145
- RNNotifyvisitors.createNotificationChannelGroup(groupId, groupName);
146
- }
147
- } catch (e) {
148
- console.log(e);
149
- }
150
- }
151
-
152
- /* 9 - Push Notification Channel Group */
153
- static deleteNotificationChannelGroup(groupId) {
154
- console.log("NV- Delete Notification Channnel Group !!");
155
- try {
156
- if (Platform.OS === 'ios') {
157
- console.log("This function is not supported on IOS");
158
- } else {
159
- RNNotifyvisitors.deleteNotificationChannelGroup(groupId);
160
- }
161
- } catch (e) {
162
- console.log(e);
163
- }
164
- }
165
-
166
- /* 10 - Unread Push Notification Count */
167
- static getNotificationCenterCount(tabCountInfo, callback) {
168
- console.log("NV- Notification push Count !!");
169
- try {
170
- RNNotifyvisitors.getNotificationCenterCount(tabCountInfo, callback);
171
- } catch (e) {
172
- console.log(e);
173
- }
174
-
175
- }
176
-
177
- /* 11 - Get FCM/APNS Device Token */
178
- static getRegistrationToken(nvCallback) {
179
- console.log("NV- FCM/APNS Device Token !!");
180
- try {
181
- RNNotifyvisitors.getRegistrationToken(nvCallback);
182
- } catch (e) {
183
- console.log(e)
184
- }
185
- }
186
-
187
- /* 12 - Play Store / App Store Rating */
188
- static requestInAppReview(nvCallback) {
189
- console.log("NV- In App Review !!");
190
- try {
191
- RNNotifyvisitors.requestInAppReview(nvCallback);
192
- } catch (e) {
193
- console.log(e)
194
- }
195
-
196
- }
197
-
198
- /* 13 - Category based Notification */
199
- static subscribePushCategory(categoryInfo, unSubscribe2All) {
200
- console.log("NV- Subscibe Push Category !!");
201
- try {
202
- RNNotifyvisitors.subscribePushCategory(categoryInfo, unSubscribe2All);
203
- } catch (e) {
204
- console.log(e)
205
- }
206
- }
207
-
208
- /* 14 - Push /InApp / Notification Center Click Callback Data */
209
- static getLinkInfo(nvCallback) {
210
- console.log("NV- Get Link Info !!");
211
- try {
212
- CALLBACKS_STACK[NV_CALLBACKS.GET_LINK_INFO] = nvCallback;
213
- RNNotifyvisitors.getLinkInfo();
214
- } catch (e) {
215
- console.log(e)
216
- }
217
-
218
- }
219
-
220
-
221
- /* 15 - Unique NotifyVisitors Identification */
222
- static getNvUID(callback) {
223
- console.log("NV- Get NV UID !!");
224
- try {
225
- RNNotifyvisitors.getNvUID(callback);
226
- } catch (e) {
227
- console.log(e);
228
- }
229
- }
230
-
231
- /* 16 - JSon Data For Custom Notification Center */
232
- static getNotificationDataListener(callback) {
233
- console.log("NV- Get Notification Data Listener !!");
234
- try {
235
- if (Platform == "ios") {
236
- RNNotifyvisitors.getNotificationDataListener("fetchEvent");
237
- }
238
- RNNotifyvisitors.getNotificationDataListener(callback);
239
- } catch (e) {
240
- console.log(e);
241
- }
242
-
243
- }
244
-
245
- /* 17 - Auto Start Library Android */
246
- static setAutoStartPermission_android_only() {
247
- console.log("NV- Auto Start Permission Android !!");
248
- try {
249
- if (Platform.OS === 'ios') {
250
- console.log("This function is not supported on IOS");
251
- } else {
252
- RNNotifyvisitors.setAutoStartPermission();
253
- }
254
- } catch (e) {
255
- console.log(e);
256
- }
257
- }
258
-
259
- /* 18 - Stop Showing InApp Banner Survey */
260
- static stopNotifications() {
261
- console.log("NV- Stop Notification !!");
262
- try {
263
- RNNotifyvisitors.stopNotifications();
264
- } catch (e) {
265
- console.log(e);
266
- }
267
-
268
- }
269
-
270
- /* 19 - Stop Showing Location Push for a custom time */
271
- static stopGeofencePushforDateTime(dateTime, additionalHours) {
272
- console.log("NV- Stop Geofence Push For Date Time !!");
273
- try {
274
- RNNotifyvisitors.stopGeofencePushforDateTime(dateTime, additionalHours);
275
- } catch (e) {
276
- console.log(e);
277
- }
278
-
279
- }
280
-
281
- /* 20 - Triger Push Notification on Panel */
282
- static scheduleNotification(nid, tag, time, title, message, url, icon) {
283
- console.log("NV- Schedule Notification !!");
284
- try {
285
- RNNotifyvisitors.scheduleNotification(nid, tag, time, title, message, url, icon);
286
- } catch (e) {
287
- console.log(e);
288
- }
289
-
290
- }
291
-
292
- /* 21 - Separate Callbacks For Events and Surveys */
293
- static getEventSurveyInfo(nvCallback) {
294
- console.log("NV- Get Event Survey Info !!");
295
- try {
296
- CALLBACKS_STACK[NV_CALLBACKS.NV_EVENT_SURVEY] = nvCallback;
297
- RNNotifyvisitors.getEventSurveyInfo(nvCallback);
298
- } catch (e) {
299
- console.log(e)
300
- }
301
-
302
- }
303
-
304
- /* 22 - Depricated Function For Notification Count */
305
- static getNotificationCount(callback) {
306
- console.log("NV- Get Notification Count !!");
307
- try {
308
- RNNotifyvisitors.getNotificationCount(callback);
309
- } catch (e) {
310
- console.log(e);
311
- }
312
-
313
- }
314
-
315
-
316
- /* 23 - IOS Specific */
317
- static scrollViewDidScroll_iOS_only() {
318
- console.log("NV- Scroll View Did Scroll IOS !!");
319
- try {
320
- RNNotifyvisitors.scrollViewDidScroll_iOS_only();
321
- } catch (e) {
322
- console.log(e);
323
- }
324
- }
325
-
326
- /* 24 - IOS Specific */
327
- static promptForPushNotificationsWithUserResponse(callback) {
328
- console.log("NV- Prompt For Push Notifications With UserResponse IOS !!");
329
- if (!checkIfInitialized()) return;
330
-
331
- if (Platform.OS === 'ios') {
332
- RNNotifyvisitors.promptForPushNotificationsWithUserResponse(callback);
333
- } else {
334
- console.log("This function is not supported on Android");
335
- }
336
- }
337
-
338
- static pushPermissionPrompt(pushPromptInfo, callback) {
339
- console.log("NV- Push Permission Prompt !!");
340
- try {
341
- if (Platform.OS === 'ios') {
342
- console.log("This function is not supported on IOS");
343
- } else {
344
- if (pushPromptInfo != null) {
345
- RNNotifyvisitors.pushPermissionPrompt(pushPromptInfo, callback);
346
- } else {
347
- let pushPromptInfo = new PushPromptInfo();
348
- RNNotifyvisitors.pushPermissionPrompt(pushPromptInfo, callback);
349
- }
350
- }
351
- } catch (e) {
352
- console.log(e);
353
- }
354
- }
46
+ /* 1 - Survery, InApp Banners */
47
+ static show(tokens, customObjects, fragmentName, nvCallback) {
48
+ console.log("NV- Show !!");
49
+ try {
50
+ CALLBACKS_STACK[NV_CALLBACKS.NV_SHOW] = nvCallback;
51
+ RNNotifyvisitors.show(tokens, customObjects, fragmentName, nvCallback);
52
+ } catch (e) {
53
+ console.log(e);
54
+ }
55
+ }
56
+
57
+ /* 2 - Notification Center */
58
+ static showNotifications(mAppInboxInfo, dismissValue) {
59
+ console.log("NV- Show Notifications !!");
60
+ try {
61
+ if (Platform.OS == "ios") {
62
+ dismissValue = dismissValue + "";
63
+ } else {
64
+ dismissValue = parseInt(dismissValue);
65
+ }
66
+ RNNotifyvisitors.showNotifications(mAppInboxInfo, dismissValue);
67
+ } catch (e) {
68
+ console.log(e);
69
+ }
70
+ }
71
+
72
+ /* 3 - Event Tracking */
73
+ static event(eventName, attributes, ltv, scope, nvCallback) {
74
+ console.log("NV- Events !!");
75
+ try {
76
+ CALLBACKS_STACK[NV_CALLBACKS.NV_EVENT] = nvCallback;
77
+ RNNotifyvisitors.event(eventName, attributes, ltv, scope, nvCallback);
78
+ } catch (e) {
79
+ console.log(e);
80
+ }
81
+ }
82
+
83
+ /* 4 - Login User */
84
+ static userIdentifier(userID, sJsonObject) {
85
+ console.log("NV- User Identifier !!");
86
+ try {
87
+ RNNotifyvisitors.userIdentifier(userID, sJsonObject);
88
+ } catch (e) {
89
+ console.log(e);
90
+ }
91
+ }
92
+
93
+ /* 5 - chatbot */
94
+ static startChatBot(screenName, nvCallback) {
95
+ console.log("NV- Chatbot !!");
96
+ try {
97
+ CALLBACKS_STACK[NV_CALLBACKS.NV_CHAT_BOT_EVENT] = nvCallback;
98
+ RNNotifyvisitors.startChatBot(screenName);
99
+ } catch (e) {
100
+ console.log(e);
101
+ }
102
+ }
103
+
104
+ /* 6 - Push Notification Channel */
105
+ static createNotificationChannel(
106
+ chId,
107
+ chName,
108
+ chDescription,
109
+ chImportance,
110
+ enableLights,
111
+ shouldVibrate,
112
+ lightColor,
113
+ soundFileName
114
+ ) {
115
+ console.log("NV- Create Notification Channnel !!");
116
+ try {
117
+ if (Platform.OS === "ios") {
118
+ console.log("This function is not supported on IOS");
119
+ } else {
120
+ RNNotifyvisitors.createNotificationChannel(
121
+ chId,
122
+ chName,
123
+ chDescription,
124
+ chImportance,
125
+ enableLights,
126
+ shouldVibrate,
127
+ lightColor,
128
+ soundFileName
129
+ );
130
+ }
131
+ } catch (e) {
132
+ console.log(e);
133
+ }
134
+ }
135
+
136
+ /* 7 - Push Notification Channel */
137
+ static deleteNotificationChannel(channelId) {
138
+ console.log("NV- Delate Notification Channnel !!");
139
+ try {
140
+ if (Platform.OS === "ios") {
141
+ console.log("This function is not supported on IOS");
142
+ } else {
143
+ RNNotifyvisitors.deleteNotificationChannel(channelId);
144
+ }
145
+ } catch (e) {
146
+ console.log(e);
147
+ }
148
+ }
149
+
150
+ /* 8 - Push Notification Channel Group */
151
+ static createNotificationChannelGroup(groupId, groupName) {
152
+ console.log("NV- Create Notification Channnel Group !!");
153
+ try {
154
+ if (Platform.OS === "ios") {
155
+ console.log("This function is not supported on IOS");
156
+ } else {
157
+ RNNotifyvisitors.createNotificationChannelGroup(groupId, groupName);
158
+ }
159
+ } catch (e) {
160
+ console.log(e);
161
+ }
162
+ }
163
+
164
+ /* 9 - Push Notification Channel Group */
165
+ static deleteNotificationChannelGroup(groupId) {
166
+ console.log("NV- Delete Notification Channnel Group !!");
167
+ try {
168
+ if (Platform.OS === "ios") {
169
+ console.log("This function is not supported on IOS");
170
+ } else {
171
+ RNNotifyvisitors.deleteNotificationChannelGroup(groupId);
172
+ }
173
+ } catch (e) {
174
+ console.log(e);
175
+ }
176
+ }
177
+
178
+ /* 10 - Unread Push Notification Count */
179
+ static getNotificationCenterCount(tabCountInfo, callback) {
180
+ console.log("NV- Notification push Count !!");
181
+ try {
182
+ RNNotifyvisitors.getNotificationCenterCount(tabCountInfo, callback);
183
+ } catch (e) {
184
+ console.log(e);
185
+ }
186
+ }
187
+
188
+ /* 11 - Get FCM/APNS Device Token */
189
+ static getRegistrationToken(nvCallback) {
190
+ console.log("NV- FCM/APNS Device Token !!");
191
+ try {
192
+ RNNotifyvisitors.getRegistrationToken(nvCallback);
193
+ } catch (e) {
194
+ console.log(e);
195
+ }
196
+ }
197
+
198
+ /* 12 - Play Store / App Store Rating */
199
+ static requestInAppReview(nvCallback) {
200
+ console.log("NV- In App Review !!");
201
+ try {
202
+ RNNotifyvisitors.requestInAppReview(nvCallback);
203
+ } catch (e) {
204
+ console.log(e);
205
+ }
206
+ }
207
+
208
+ /* 13 - Category based Notification */
209
+ static subscribePushCategory(categoryInfo, unSubscribe2All) {
210
+ console.log("NV- Subscibe Push Category !!");
211
+ try {
212
+ RNNotifyvisitors.subscribePushCategory(categoryInfo, unSubscribe2All);
213
+ } catch (e) {
214
+ console.log(e);
215
+ }
216
+ }
217
+
218
+ /* 14 - Push /InApp / Notification Center Click Callback Data */
219
+ static getLinkInfo(nvCallback) {
220
+ console.log("NV- Get Link Info !!");
221
+ try {
222
+ CALLBACKS_STACK[NV_CALLBACKS.GET_LINK_INFO] = nvCallback;
223
+ RNNotifyvisitors.getLinkInfo();
224
+ } catch (e) {
225
+ console.log(e);
226
+ }
227
+ }
228
+
229
+ /* 15 - Unique NotifyVisitors Identification */
230
+ static getNvUID(callback) {
231
+ console.log("NV- Get NV UID !!");
232
+ try {
233
+ RNNotifyvisitors.getNvUID(callback);
234
+ } catch (e) {
235
+ console.log(e);
236
+ }
237
+ }
238
+
239
+ /* 16 - JSon Data For Custom Notification Center */
240
+
241
+ static getNotificationDataListener(callback) {
242
+ console.log("NV- Get Notification Data Listener !!");
243
+ try {
244
+ if (Platform == "ios") {
245
+ RNNotifyvisitors.getNotificationDataListener("fetchEvent");
246
+ }
247
+ RNNotifyvisitors.getNotificationDataListener(callback);
248
+ } catch (e) {
249
+ console.log(e);
250
+ }
251
+ }
252
+
253
+ static getNotificationCenterData(callback) {
254
+ console.log("NV- Get Notification Data callback !!");
255
+ try {
256
+ RNNotifyvisitors.getNotificationCenterData(callback);
257
+ } catch (e) {
258
+ console.log(e);
259
+ }
260
+ }
261
+
262
+ /* 17 - Auto Start Library Android */
263
+ static setAutoStartPermission_android_only() {
264
+ console.log("NV- Auto Start Permission Android !!");
265
+ try {
266
+ if (Platform.OS === "ios") {
267
+ console.log("This function is not supported on IOS");
268
+ } else {
269
+ RNNotifyvisitors.setAutoStartPermission();
270
+ }
271
+ } catch (e) {
272
+ console.log(e);
273
+ }
274
+ }
275
+
276
+ /* 18 - Stop Showing InApp Banner Survey */
277
+ static stopNotifications() {
278
+ console.log("NV- Stop Notification !!");
279
+ try {
280
+ RNNotifyvisitors.stopNotifications();
281
+ } catch (e) {
282
+ console.log(e);
283
+ }
284
+ }
285
+
286
+ /* 19 - Stop Showing Location Push for a custom time */
287
+ static stopGeofencePushforDateTime(dateTime, additionalHours) {
288
+ console.log("NV- Stop Geofence Push For Date Time !!");
289
+ try {
290
+ RNNotifyvisitors.stopGeofencePushforDateTime(dateTime, additionalHours);
291
+ } catch (e) {
292
+ console.log(e);
293
+ }
294
+ }
295
+
296
+ /* 20 - Triger Push Notification on Panel */
297
+ static scheduleNotification(nid, tag, time, title, message, url, icon) {
298
+ console.log("NV- Schedule Notification !!");
299
+ try {
300
+ RNNotifyvisitors.scheduleNotification(
301
+ nid,
302
+ tag,
303
+ time,
304
+ title,
305
+ message,
306
+ url,
307
+ icon
308
+ );
309
+ } catch (e) {
310
+ console.log(e);
311
+ }
312
+ }
313
+
314
+ /* 21 - Separate Callbacks For Events and Surveys */
315
+ static getEventSurveyInfo(nvCallback) {
316
+ console.log("NV- Get Event Survey Info !!");
317
+ try {
318
+ CALLBACKS_STACK[NV_CALLBACKS.NV_EVENT_SURVEY] = nvCallback;
319
+ RNNotifyvisitors.getEventSurveyInfo(nvCallback);
320
+ } catch (e) {
321
+ console.log(e);
322
+ }
323
+ }
324
+
325
+ /* 22 - Depricated Function For Notification Count */
326
+ static getNotificationCount(callback) {
327
+ console.log("NV- Get Notification Count !!");
328
+ try {
329
+ RNNotifyvisitors.getNotificationCount(callback);
330
+ } catch (e) {
331
+ console.log(e);
332
+ }
333
+ }
334
+
335
+ /* 23 - IOS Specific */
336
+ static scrollViewDidScroll_iOS_only() {
337
+ console.log("NV- Scroll View Did Scroll IOS !!");
338
+ try {
339
+ RNNotifyvisitors.scrollViewDidScroll_iOS_only();
340
+ } catch (e) {
341
+ console.log(e);
342
+ }
343
+ }
344
+
345
+ /* 24 - IOS Specific */
346
+ static promptForPushNotificationsWithUserResponse(callback) {
347
+ console.log("NV- Prompt For Push Notifications With UserResponse IOS !!");
348
+ if (!checkIfInitialized()) return;
349
+
350
+ if (Platform.OS === "ios") {
351
+ RNNotifyvisitors.promptForPushNotificationsWithUserResponse(callback);
352
+ } else {
353
+ console.log("This function is not supported on Android");
354
+ }
355
+ }
356
+
357
+ static pushPermissionPrompt(pushPromptInfo, callback) {
358
+ console.log("NV- Push Permission Prompt !!");
359
+ try {
360
+ if (Platform.OS === "ios") {
361
+ console.log("This function is not supported on IOS");
362
+ } else {
363
+ if (pushPromptInfo != null) {
364
+ RNNotifyvisitors.pushPermissionPrompt(pushPromptInfo, callback);
365
+ } else {
366
+ let pushPromptInfo = new PushPromptInfo();
367
+ RNNotifyvisitors.pushPermissionPrompt(pushPromptInfo, callback);
368
+ }
369
+ }
370
+ } catch (e) {
371
+ console.log(e);
372
+ }
373
+ }
355
374
  }
356
375
 
357
376
  export class PushPromptInfo {
358
- constructor() {
359
- this.title = "Get Notified \uD83D\uDD14";
360
- this.titleTextColor = "#000000";
361
- this.description =
362
- "Please Enable Push Notifications on Your Device For Latest Updates !!";
363
- this.descriptionTextColor = "#000000";
364
- this.backgroundColor = "#EBEDEF";
365
- this.buttonOneBorderColor = "#6db76c";
366
- this.buttonOneBackgroundColor = "#26a524";
367
- this.buttonOneBorderRadius = "25";
368
- this.buttonOneText = "Allow";
369
- this.buttonOneTextColor = "#FFFFFF";
370
- this.buttonTwoText = "Deny";
371
- this.buttonTwoTextColor = "#FFFFFF";
372
- this.buttonTwoBackgroundColor = "#FF0000";
373
- this.buttonTwoBorderColor = "#6db76c";
374
- this.buttonTwoBorderRadius = "25";
375
- this.numberOfSessions = "3";
376
- this.resumeInDays = "5";
377
- this.numberOfTimesPerSession = "2";
378
- }
377
+ constructor() {
378
+ this.title = "Get Notified \uD83D\uDD14";
379
+ this.titleTextColor = "#000000";
380
+ this.description =
381
+ "Please Enable Push Notifications on Your Device For Latest Updates !!";
382
+ this.descriptionTextColor = "#000000";
383
+ this.backgroundColor = "#EBEDEF";
384
+ this.buttonOneBorderColor = "#6db76c";
385
+ this.buttonOneBackgroundColor = "#26a524";
386
+ this.buttonOneBorderRadius = "25";
387
+ this.buttonOneText = "Allow";
388
+ this.buttonOneTextColor = "#FFFFFF";
389
+ this.buttonTwoText = "Deny";
390
+ this.buttonTwoTextColor = "#FFFFFF";
391
+ this.buttonTwoBackgroundColor = "#FF0000";
392
+ this.buttonTwoBorderColor = "#6db76c";
393
+ this.buttonTwoBorderRadius = "25";
394
+ this.numberOfSessions = "3";
395
+ this.resumeInDays = "5";
396
+ this.numberOfTimesPerSession = "2";
397
+ }
379
398
  }
380
-