react-native-notifyvisitors 4.4.1 → 4.4.2

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/index.js CHANGED
@@ -11,6 +11,8 @@ const NV_CALLBACKS = {
11
11
  NV_SHOW: "nv_show_callback",
12
12
  NV_EVENT: "nv_event_callback",
13
13
  NV_EVENT_SURVEY: "nv_common_show_event_callback",
14
+ NV_CENTER: "nv_center_callback",
15
+ NV_KNOWN_USER_IDENTIFIED: "nv_known_user_identified_callback",
14
16
  };
15
17
 
16
18
  const CALLBACKS_STACK = {};
@@ -54,6 +56,16 @@ export default class Notifyvisitors {
54
56
  }
55
57
  }
56
58
 
59
+ static showInAppMessage(tokens, customObjects, fragmentName, nvCallback) {
60
+ console.log("NV- Show InApp Message !!");
61
+ try {
62
+ CALLBACKS_STACK[NV_CALLBACKS.NV_SHOW] = nvCallback;
63
+ RNNotifyvisitors.showInAppMessage(tokens, customObjects, fragmentName, nvCallback);
64
+ } catch (e) {
65
+ console.log(e);
66
+ }
67
+ }
68
+
57
69
  /* 2 - Notification Center */
58
70
  static showNotifications(mAppInboxInfo, dismissValue) {
59
71
  console.log("NV- Show Notifications !!");
@@ -69,6 +81,21 @@ export default class Notifyvisitors {
69
81
  }
70
82
  }
71
83
 
84
+ static openNotificationCenter(mAppInboxInfo, dismissValue, callback) {
85
+ console.log("NV- Open Notification Center !!");
86
+ try {
87
+ if (Platform.OS == "ios") {
88
+ dismissValue = dismissValue + "";
89
+ } else {
90
+ dismissValue = parseInt(dismissValue);
91
+ }
92
+ CALLBACKS_STACK[NV_CALLBACKS.NV_CENTER] = callback;
93
+ RNNotifyvisitors.openNotificationCenter(mAppInboxInfo, dismissValue, callback);
94
+ } catch (e) {
95
+ console.log(e);
96
+ }
97
+ }
98
+
72
99
  /* 3 - Event Tracking */
73
100
  static event(eventName, attributes, ltv, scope, nvCallback) {
74
101
  console.log("NV- Events !!");
@@ -90,6 +117,15 @@ export default class Notifyvisitors {
90
117
  }
91
118
  }
92
119
 
120
+ static setUserIdentifier(sJsonObject, callback) {
121
+ console.log("NV- Set User Identifier !!");
122
+ try {
123
+ RNNotifyvisitors.setUserIdentifier(sJsonObject, callback);
124
+ } catch (e) {
125
+ console.log(e);
126
+ }
127
+ }
128
+
93
129
  /* 5 - chatbot */
94
130
  static startChatBot(screenName, nvCallback) {
95
131
  console.log("NV- Chatbot !!");
@@ -406,6 +442,45 @@ export default class Notifyvisitors {
406
442
  console.log(e);
407
443
  }
408
444
  }
445
+
446
+ static knownUserIdentified(callback) {
447
+ console.log("NV- Known User Identified !!");
448
+ try {
449
+ CALLBACKS_STACK[NV_CALLBACKS.NV_KNOWN_USER_IDENTIFIED] = callback;
450
+ RNNotifyvisitors.knownUserIdentified(callback);
451
+ } catch (e) {
452
+ console.log(e);
453
+ }
454
+ }
455
+
456
+ static isPayloadFromNvPlatform(pushPayload, callback) {
457
+ console.log("NV- Is Payload From NV Platform !!");
458
+
459
+ try {
460
+ if (Platform.OS === "ios") {
461
+ console.log("This function is not supported on IOS");
462
+ } else {
463
+ console.log("This function is supported on Android");
464
+ RNNotifyvisitors.isPayloadFromNvPlatform(pushPayload, callback);
465
+ }
466
+ } catch (e) {
467
+ console.log(e);
468
+ }
469
+ }
470
+
471
+ static getNV_FCMPayload(pushPayload) {
472
+ console.log("NV- Get NV FCM Payload !!");
473
+
474
+ try {
475
+ if (Platform.OS === "ios") {
476
+ console.log("This function is not supported on IOS");
477
+ } else {
478
+ RNNotifyvisitors.getNV_FCMPayload(pushPayload);
479
+ }
480
+ } catch (e) {
481
+ console.log(e);
482
+ }
483
+ }
409
484
  }
410
485
 
411
486
  export class PushPromptInfo {