react-native-notifyvisitors 4.6.0 → 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (14) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/java/com/rn_notifyvisitors/RNNotifyvisitorsModule.java +71 -18
  3. package/ios/RNNotifyvisitors/RNNotifyvisitors.m +1 -1
  4. package/package.json +1 -1
  5. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-maccatalyst/notifyvisitorsNudges.framework/Versions/A/Modules/notifyvisitorsNudges.swiftmodule/arm64-apple-ios-macabi.abi.json +0 -2155
  6. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-maccatalyst/notifyvisitorsNudges.framework/Versions/A/Modules/notifyvisitorsNudges.swiftmodule/arm64-apple-ios-macabi.swiftdoc +0 -0
  7. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-maccatalyst/notifyvisitorsNudges.framework/Versions/A/Modules/notifyvisitorsNudges.swiftmodule/arm64-apple-ios-macabi.swiftinterface +0 -42
  8. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-maccatalyst/notifyvisitorsNudges.framework/Versions/A/Modules/notifyvisitorsNudges.swiftmodule/x86_64-apple-ios-macabi.abi.json +0 -2155
  9. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-maccatalyst/notifyvisitorsNudges.framework/Versions/A/Modules/notifyvisitorsNudges.swiftmodule/x86_64-apple-ios-macabi.swiftdoc +0 -0
  10. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-maccatalyst/notifyvisitorsNudges.framework/Versions/A/Modules/notifyvisitorsNudges.swiftmodule/x86_64-apple-ios-macabi.swiftinterface +0 -42
  11. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-simulator/notifyvisitorsNudges.framework/Modules/notifyvisitorsNudges.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -42
  12. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-simulator/notifyvisitorsNudges.framework/Modules/notifyvisitorsNudges.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -42
  13. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-simulator/notifyvisitorsNudges.framework/Modules/notifyvisitorsNudges.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -42
  14. package/ios/notifyvisitorsNudges.xcframework/ios-arm64_x86_64-simulator/notifyvisitorsNudges.framework/Modules/notifyvisitorsNudges.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -42
@@ -35,7 +35,7 @@ android {
35
35
  dependencies {
36
36
  implementation fileTree(dir: 'libs', include: ['*.jar'])
37
37
  implementation 'com.facebook.react:react-native:+'
38
- implementation('com.notifyvisitors.notifyvisitors:notifyvisitors:v5.6.0')
38
+ implementation('com.notifyvisitors.notifyvisitors:notifyvisitors:v5.6.1')
39
39
  implementation("com.notifyvisitors.nudges:notifyvisitors-nudges:v0.0.8")
40
40
  implementation platform('com.google.firebase:firebase-bom:33.16.0')
41
41
  implementation ('com.google.firebase:firebase-messaging')
@@ -50,7 +50,7 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
50
50
 
51
51
  private final ReactApplicationContext reactContext;
52
52
  private static final String TAG = "RN-NotifyVisitors";
53
- private static final String PLUGIN_VERSION = "4.6.0";
53
+ private static final String PLUGIN_VERSION = "4.6.1";
54
54
 
55
55
  private String PUSH_BANNER_CLICK_EVENT = "nv_push_banner_click";
56
56
  private String CHAT_BOT_BUTTON_CLICK = "nv_chat_bot_button_click";
@@ -237,7 +237,7 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
237
237
  }
238
238
 
239
239
  } catch (Exception e) {
240
- Log.i(TAG, "GET SESSION DATA ERROR : " + e);
240
+ Log.e(TAG, "GET SESSION DATA ERROR : " + e);
241
241
  }
242
242
  }
243
243
 
@@ -250,13 +250,19 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
250
250
  NotifyVisitorsApi.getInstance(reactContext).notificationClickCallback(new OnNotificationClicksHandler() {
251
251
  @Override
252
252
  public void onClick(JSONObject jsonObject) {
253
- if (jsonObject != null) {
254
- sendEvent(NV_NOTIFICATION_CLICK_CALLBACK, jsonObject.toString());
253
+ try {
254
+ if (jsonObject != null) {
255
+ sendEvent(NV_NOTIFICATION_CLICK_CALLBACK, jsonObject.toString());
256
+ } else {
257
+ sendEvent(NV_NOTIFICATION_CLICK_CALLBACK, "unavailable");
258
+ }
259
+ } catch (Exception e) {
260
+ Log.e(TAG, "NOTIFICATION CLICK CALLBACK ERROR 2 : " + e);
255
261
  }
256
262
  }
257
263
  });
258
264
  } catch (Exception e) {
259
- Log.i(TAG, "NOTIFICATION CLICK CALLBACK ERROR : " + e);
265
+ Log.e(TAG, "NOTIFICATION CLICK CALLBACK ERROR : " + e);
260
266
  }
261
267
  }
262
268
 
@@ -307,7 +313,15 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
307
313
  NotifyVisitorsApi.getInstance(mActivity).show(mTokens, mCustomObjects, fragmentName, new OnInAppTriggerListener() {
308
314
  @Override
309
315
  public void onDisplay(JSONObject response) {
310
- sendEvent(SHOW_CALLBACK, response.toString());
316
+ try {
317
+ if (response != null) {
318
+ sendEvent(SHOW_CALLBACK, response.toString());
319
+ } else {
320
+ sendEvent(SHOW_CALLBACK, "{}");
321
+ }
322
+ } catch (Exception e) {
323
+ Log.e(TAG, "SHOW IN APP MESSAGE ERROR : " + e);
324
+ }
311
325
  }
312
326
  });
313
327
  }
@@ -746,7 +760,11 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
746
760
  NotifyVisitorsApi.getInstance(reactContext).userIdentifier(mAttributes, new OnUserTrackListener() {
747
761
  @Override
748
762
  public void onResponse(JSONObject data) {
749
- callback.invoke(data.toString());
763
+ if (data != null) {
764
+ callback.invoke(data.toString());
765
+ } else {
766
+ callback.invoke("{}");
767
+ }
750
768
  }
751
769
  });
752
770
  } catch (Exception e) {
@@ -1131,8 +1149,16 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
1131
1149
  NotifyVisitorsApi.getInstance(reactContext).getNotificationDataListener(new NotificationListDetailsCallback() {
1132
1150
  @Override
1133
1151
  public void getNotificationData(JSONArray notificationListResponse) {
1134
- Log.i(TAG, "RESPONSE : " + notificationListResponse);
1135
- callback.invoke(notificationListResponse.toString());
1152
+ try {
1153
+ //Log.i(TAG, "RESPONSE : " + notificationListResponse);
1154
+ if (notificationListResponse != null) {
1155
+ callback.invoke(notificationListResponse.toString());
1156
+ } else {
1157
+ callback.invoke("[]"); // Return empty array if null
1158
+ }
1159
+ } catch (Exception e) {
1160
+ Log.i(TAG, "GET NOTIFICATION DATA LISTENER ERROR 2 : " + e);
1161
+ }
1136
1162
  }
1137
1163
  }, 0);
1138
1164
  }
@@ -1157,8 +1183,14 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
1157
1183
  NotifyVisitorsApi.getInstance(mActivity).getNotificationCenterData(new OnCenterDataListener() {
1158
1184
  @Override
1159
1185
  public void getData(JSONObject jsonObject) {
1160
- Log.i(TAG, "RESPONSE : " + jsonObject);
1161
- callback.invoke(jsonObject.toString());
1186
+ try {
1187
+ //Log.i(TAG, "RESPONSE : " + jsonObject);
1188
+ if (jsonObject != null) {
1189
+ callback.invoke(jsonObject.toString());
1190
+ }
1191
+ } catch (Exception e) {
1192
+ Log.i(TAG, "GET NOTIFICATION CENTER DATA ERROR 2 : " + e);
1193
+ }
1162
1194
  }
1163
1195
  });
1164
1196
  }
@@ -1265,9 +1297,16 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
1265
1297
  NotifyVisitorsApi.getInstance(reactContext).getNotificationCount(new NotificationCountInterface() {
1266
1298
  @Override
1267
1299
  public void getCount(int count) {
1268
- Log.i(TAG, "COUNT : " + count);
1269
- String strI = String.valueOf(count);
1270
- callback.invoke(strI);
1300
+ try {
1301
+ Log.i(TAG, "COUNT : " + count);
1302
+ String strI = String.valueOf(count);
1303
+ if (strI == null || strI.isEmpty()) {
1304
+ strI = "0";
1305
+ }
1306
+ callback.invoke(strI);
1307
+ } catch (Exception e) {
1308
+ Log.i(TAG, "GET NOTIFICATION COUNT ERROR 2 : " + e);
1309
+ }
1271
1310
  }
1272
1311
  });
1273
1312
  } catch (Exception e) {
@@ -1325,8 +1364,16 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
1325
1364
  NotifyVisitorsApi.getInstance(mActivity).activatePushPermissionPopup(design, new OnPushRuntimePermission() {
1326
1365
  @Override
1327
1366
  public void getPopupInfo(JSONObject result) {
1328
- Log.i(TAG, "Popup Response => " + result);
1329
- callback.invoke(result.toString());
1367
+ try {
1368
+ Log.i(TAG, "Popup Response => " + result);
1369
+ if (result != null) {
1370
+ callback.invoke(result.toString());
1371
+ }
1372
+ } catch (Exception e) {
1373
+ Log.i(TAG, "PUSH PERMISSION PROMPT ERROR 2 : " + e);
1374
+ }
1375
+
1376
+
1330
1377
  }
1331
1378
  });
1332
1379
  }
@@ -1376,8 +1423,14 @@ public class RNNotifyvisitorsModule extends ReactContextBaseJavaModule implement
1376
1423
  NotifyVisitorsApi.getInstance(mActivity).nativePushPermissionPrompt(new OnPushRuntimePermission() {
1377
1424
  @Override
1378
1425
  public void getPopupInfo(JSONObject result) {
1379
- Log.i(TAG, "Popup Response => " + result);
1380
- callback.invoke(result.toString());
1426
+ try {
1427
+ Log.i(TAG, "Popup Response => " + result);
1428
+ if (result != null) {
1429
+ callback.invoke(result.toString());
1430
+ }
1431
+ } catch (Exception e) {
1432
+ Log.i(TAG, "NATIVE PUSH PERMISSION PROMPT ERROR 2 : " + e);
1433
+ }
1381
1434
  }
1382
1435
  });
1383
1436
  }
@@ -23,7 +23,7 @@ int nvCheckPushClickTimeCounter = 0;
23
23
 
24
24
  @implementation RNNotifyvisitors
25
25
 
26
- static NSString *const kNVPluginVersion = @"4.6.0";
26
+ static NSString *const kNVPluginVersion = @"4.6.1";
27
27
 
28
28
  - (dispatch_queue_t)methodQueue{
29
29
  return dispatch_get_main_queue();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-notifyvisitors",
3
- "version": "4.6.0",
3
+ "version": "4.6.1",
4
4
  "description": "React Native Notifyvisitors SDK for push notifications and surveys",
5
5
  "main": "index",
6
6
  "scripts": {