@luciq/react-native 19.3.0 → 19.4.0-44237-SNAPSHOT

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 (110) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +118 -0
  3. package/RNLuciq.podspec +6 -2
  4. package/android/build.gradle +25 -0
  5. package/android/native.gradle +1 -1
  6. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +3 -3
  7. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqBugReportingModule.java +28 -24
  8. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqCrashReportingModule.java +18 -7
  9. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsModule.java +1 -2
  10. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerModule.java +24 -29
  11. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +112 -16
  12. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativePackage.java +2 -0
  13. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqRepliesModule.java +4 -16
  14. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +5 -16
  15. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSurveysModule.java +7 -15
  16. package/android/src/main/java/ai/luciq/reactlibrary/utils/ReportUtil.java +0 -7
  17. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqAPMBaseSpec.java +9 -0
  18. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqBaseSpec.java +33 -0
  19. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqBugReportingBaseSpec.java +33 -0
  20. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqCrashReportingBaseSpec.java +9 -0
  21. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsBaseSpec.java +9 -0
  22. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerBaseSpec.java +33 -0
  23. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqRepliesBaseSpec.java +33 -0
  24. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqSessionReplayBaseSpec.java +33 -0
  25. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqSurveysBaseSpec.java +33 -0
  26. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqAPMBaseSpec.java +11 -0
  27. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqBaseSpec.java +22 -0
  28. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqBugReportingBaseSpec.java +22 -0
  29. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqCrashReportingBaseSpec.java +10 -0
  30. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsBaseSpec.java +10 -0
  31. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerBaseSpec.java +22 -0
  32. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqRepliesBaseSpec.java +22 -0
  33. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqSessionReplayBaseSpec.java +22 -0
  34. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqSurveysBaseSpec.java +22 -0
  35. package/dist/modules/BugReporting.js +3 -3
  36. package/dist/modules/Luciq.d.ts +15 -0
  37. package/dist/modules/Luciq.js +22 -1
  38. package/dist/modules/Replies.js +1 -1
  39. package/dist/modules/Surveys.js +2 -2
  40. package/dist/native/NativeBugReporting.d.ts +4 -4
  41. package/dist/native/NativeCrashReporting.d.ts +2 -2
  42. package/dist/native/NativeLuciq.d.ts +5 -3
  43. package/dist/native/NativePackage.js +25 -2
  44. package/dist/native/NativeReplies.d.ts +1 -1
  45. package/dist/native/NativeSurveys.d.ts +2 -2
  46. package/dist/native/specs/NativeAPM.d.ts +21 -0
  47. package/dist/native/specs/NativeAPM.js +2 -0
  48. package/dist/native/specs/NativeBugReporting.d.ts +29 -0
  49. package/dist/native/specs/NativeBugReporting.js +2 -0
  50. package/dist/native/specs/NativeCrashReporting.d.ts +12 -0
  51. package/dist/native/specs/NativeCrashReporting.js +2 -0
  52. package/dist/native/specs/NativeFeatureRequests.d.ts +8 -0
  53. package/dist/native/specs/NativeFeatureRequests.js +2 -0
  54. package/dist/native/specs/NativeLuciq.d.ts +80 -0
  55. package/dist/native/specs/NativeLuciq.js +2 -0
  56. package/dist/native/specs/NativeNetworkLogger.d.ts +16 -0
  57. package/dist/native/specs/NativeNetworkLogger.js +2 -0
  58. package/dist/native/specs/NativeReplies.d.ts +21 -0
  59. package/dist/native/specs/NativeReplies.js +2 -0
  60. package/dist/native/specs/NativeSessionReplay.d.ts +17 -0
  61. package/dist/native/specs/NativeSessionReplay.js +2 -0
  62. package/dist/native/specs/NativeSurveys.d.ts +18 -0
  63. package/dist/native/specs/NativeSurveys.js +2 -0
  64. package/dist/utils/Enums.js +3 -1
  65. package/dist/utils/LuciqUtils.d.ts +1 -1
  66. package/dist/utils/LuciqUtils.js +0 -3
  67. package/ios/RNLuciq/LuciqAPMBridge.h +5 -5
  68. package/ios/RNLuciq/{LuciqAPMBridge.m → LuciqAPMBridge.mm} +48 -39
  69. package/ios/RNLuciq/LuciqBugReportingBridge.h +6 -6
  70. package/ios/RNLuciq/LuciqBugReportingBridge.mm +234 -0
  71. package/ios/RNLuciq/LuciqCrashReportingBridge.h +16 -5
  72. package/ios/RNLuciq/LuciqCrashReportingBridge.mm +91 -0
  73. package/ios/RNLuciq/LuciqFeatureRequestsBridge.h +1 -1
  74. package/ios/RNLuciq/{LuciqFeatureRequestsBridge.m → LuciqFeatureRequestsBridge.mm} +21 -16
  75. package/ios/RNLuciq/LuciqNetworkLoggerBridge.h +1 -30
  76. package/ios/RNLuciq/{LuciqNetworkLoggerBridge.m → LuciqNetworkLoggerBridge.mm} +46 -77
  77. package/ios/RNLuciq/LuciqReactBridge.h +13 -13
  78. package/ios/RNLuciq/{LuciqReactBridge.m → LuciqReactBridge.mm} +95 -34
  79. package/ios/RNLuciq/LuciqRepliesBridge.h +3 -3
  80. package/ios/RNLuciq/LuciqRepliesBridge.mm +86 -0
  81. package/ios/RNLuciq/LuciqSessionReplayBridge.h +5 -5
  82. package/ios/RNLuciq/{LuciqSessionReplayBridge.m → LuciqSessionReplayBridge.mm} +35 -25
  83. package/ios/RNLuciq/LuciqSurveysBridge.h +5 -5
  84. package/ios/RNLuciq/{LuciqSurveysBridge.m → LuciqSurveysBridge.mm} +34 -35
  85. package/ios/native.rb +1 -1
  86. package/package.json +9 -2
  87. package/src/modules/BugReporting.ts +3 -3
  88. package/src/modules/Luciq.ts +25 -1
  89. package/src/modules/Replies.ts +1 -1
  90. package/src/modules/Surveys.ts +2 -2
  91. package/src/native/NativeBugReporting.ts +3 -6
  92. package/src/native/NativeCrashReporting.ts +2 -2
  93. package/src/native/NativeLuciq.ts +7 -3
  94. package/src/native/NativePackage.ts +52 -2
  95. package/src/native/NativeReplies.ts +1 -1
  96. package/src/native/NativeSurveys.ts +2 -2
  97. package/src/native/specs/NativeAPM.ts +47 -0
  98. package/src/native/specs/NativeBugReporting.ts +53 -0
  99. package/src/native/specs/NativeCrashReporting.ts +23 -0
  100. package/src/native/specs/NativeFeatureRequests.ts +10 -0
  101. package/src/native/specs/NativeLuciq.ts +137 -0
  102. package/src/native/specs/NativeNetworkLogger.ts +31 -0
  103. package/src/native/specs/NativeReplies.ts +27 -0
  104. package/src/native/specs/NativeSessionReplay.ts +20 -0
  105. package/src/native/specs/NativeSurveys.ts +23 -0
  106. package/src/utils/Enums.ts +4 -1
  107. package/src/utils/LuciqUtils.ts +1 -6
  108. package/ios/RNLuciq/LuciqBugReportingBridge.m +0 -249
  109. package/ios/RNLuciq/LuciqCrashReportingBridge.m +0 -68
  110. package/ios/RNLuciq/LuciqRepliesBridge.m +0 -80
@@ -83,7 +83,7 @@ import javax.annotation.Nullable;
83
83
  /**
84
84
  * The type Rn luciq reactnative module.
85
85
  */
86
- public class RNLuciqReactnativeModule extends EventEmitterModule {
86
+ public class RNLuciqReactnativeModule extends RNLuciqBaseSpec {
87
87
 
88
88
  private static final String TAG = "Luciq-RN-Core";
89
89
 
@@ -111,16 +111,6 @@ public class RNLuciqReactnativeModule extends EventEmitterModule {
111
111
  }
112
112
 
113
113
 
114
- @ReactMethod
115
- public void addListener(String event) {
116
- super.addListener(event);
117
- }
118
-
119
- @ReactMethod
120
- public void removeListeners(Integer count) {
121
- super.removeListeners(count);
122
- }
123
-
124
114
  /**
125
115
  * Enables or disables Luciq functionality.
126
116
  * @param isEnabled A boolean to enable/disable Luciq.
@@ -703,7 +693,7 @@ public class RNLuciqReactnativeModule extends EventEmitterModule {
703
693
  * report.
704
694
  */
705
695
  @ReactMethod
706
- public void setPreSendingHandler(final Callback preSendingHandler) {
696
+ public void setPreSendingHandler() {
707
697
  MainThreadHandler.runOnMainThread(new Runnable() {
708
698
  @Override
709
699
  public void run() {
@@ -1017,12 +1007,14 @@ public class RNLuciqReactnativeModule extends EventEmitterModule {
1017
1007
 
1018
1008
 
1019
1009
  @ReactMethod
1020
- public void addPrivateView(final int reactTag) {
1010
+ public void addPrivateView(@Nullable final Double reactTag) {
1011
+ if (reactTag == null) return;
1012
+ final int tag = reactTag.intValue();
1021
1013
  MainThreadHandler.runOnMainThread(new Runnable() {
1022
1014
  @Override
1023
1015
  public void run() {
1024
1016
  try {
1025
- final View view = resolveReactView(reactTag);
1017
+ final View view = resolveReactView(tag);
1026
1018
 
1027
1019
  if(view !=null){
1028
1020
  Luciq.addPrivateViews(view);
@@ -1035,12 +1027,14 @@ public class RNLuciqReactnativeModule extends EventEmitterModule {
1035
1027
  }
1036
1028
 
1037
1029
  @ReactMethod
1038
- public void removePrivateView(final int reactTag) {
1030
+ public void removePrivateView(@Nullable final Double reactTag) {
1031
+ if (reactTag == null) return;
1032
+ final int tag = reactTag.intValue();
1039
1033
  MainThreadHandler.runOnMainThread(new Runnable() {
1040
1034
  @Override
1041
1035
  public void run() {
1042
1036
  try {
1043
- final View view = resolveReactView(reactTag);
1037
+ final View view = resolveReactView(tag);
1044
1038
  if(view !=null){
1045
1039
 
1046
1040
  Luciq.removePrivateViews(view);
@@ -1281,6 +1275,15 @@ public class RNLuciqReactnativeModule extends EventEmitterModule {
1281
1275
  return constants;
1282
1276
  }
1283
1277
 
1278
+ @ReactMethod(isBlockingSynchronousMethod = true)
1279
+ public WritableMap getAllConstants() {
1280
+ final WritableMap map = Arguments.createMap();
1281
+ for (Map.Entry<String, Object> entry : getConstants().entrySet()) {
1282
+ map.putString(entry.getKey(), String.valueOf(entry.getValue()));
1283
+ }
1284
+ return map;
1285
+ }
1286
+
1284
1287
 
1285
1288
  @ReactMethod
1286
1289
  public void setOnFeaturesUpdatedListener() {
@@ -1373,6 +1376,49 @@ public class RNLuciqReactnativeModule extends EventEmitterModule {
1373
1376
  e.printStackTrace();
1374
1377
  }
1375
1378
  }
1379
+
1380
+ /**
1381
+ * Enables or disables WebView monitoring.
1382
+ *
1383
+ * @param isEnabled A boolean to enable/disable WebView monitoring.
1384
+ */
1385
+ @ReactMethod
1386
+ public void setWebViewMonitoringEnabled(final boolean isEnabled) {
1387
+ try {
1388
+ Luciq.setWebViewMonitoringEnabled(isEnabled);
1389
+ } catch (Exception e) {
1390
+ e.printStackTrace();
1391
+ }
1392
+ }
1393
+
1394
+ /**
1395
+ * Enables or disables WebView network tracking.
1396
+ *
1397
+ * @param isEnabled A boolean to enable/disable WebView network tracking.
1398
+ */
1399
+ @ReactMethod
1400
+ public void setWebViewNetworkTrackingEnabled(final boolean isEnabled) {
1401
+ try {
1402
+ Luciq.setWebViewNetworkTrackingEnabled(isEnabled);
1403
+ } catch (Exception e) {
1404
+ e.printStackTrace();
1405
+ }
1406
+ }
1407
+
1408
+ /**
1409
+ * Enables or disables WebView user interactions tracking.
1410
+ *
1411
+ * @param isEnabled A boolean to enable/disable WebView user interactions tracking.
1412
+ */
1413
+ @ReactMethod
1414
+ public void setWebViewUserInteractionsTrackingEnabled(final boolean isEnabled) {
1415
+ try {
1416
+ Luciq.setWebViewUserInteractionsTrackingEnabled(isEnabled);
1417
+ } catch (Exception e) {
1418
+ e.printStackTrace();
1419
+ }
1420
+ }
1421
+
1376
1422
  /**
1377
1423
  * Sets the theme for Luciq using a configuration object.
1378
1424
  *
@@ -1628,4 +1674,54 @@ private String getFileName(String path) {
1628
1674
  }
1629
1675
  });
1630
1676
  }
1677
+
1678
+ @ReactMethod
1679
+ public void setLCQLogPrintsToConsole(boolean printsToConsole) {
1680
+ }
1681
+
1682
+ @ReactMethod
1683
+ public void setPrimaryColor(@Nullable Double color) {
1684
+ }
1685
+
1686
+ @ReactMethod
1687
+ public void networkLogIOS(String url,
1688
+ String method,
1689
+ @Nullable String requestBody,
1690
+ double requestBodySize,
1691
+ @Nullable String responseBody,
1692
+ double responseBodySize,
1693
+ double responseCode,
1694
+ ReadableMap requestHeaders,
1695
+ ReadableMap responseHeaders,
1696
+ String contentType,
1697
+ String errorDomain,
1698
+ double errorCode,
1699
+ double startTime,
1700
+ double duration,
1701
+ @Nullable String gqlQueryName,
1702
+ @Nullable String serverErrorMessage,
1703
+ ReadableMap w3cExternalTraceAttributes) {
1704
+ }
1705
+
1706
+ @ReactMethod
1707
+ public void setNetworkLoggingEnabled(boolean isEnabled) {
1708
+ }
1709
+
1710
+ @ReactMethod
1711
+ public void setTrackUserSteps(final boolean isEnabled) {
1712
+ MainThreadHandler.runOnMainThread(new Runnable() {
1713
+ @Override
1714
+ public void run() {
1715
+ try {
1716
+ if (isEnabled) {
1717
+ Luciq.setTrackingUserStepsState(Feature.State.ENABLED);
1718
+ } else {
1719
+ Luciq.setTrackingUserStepsState(Feature.State.DISABLED);
1720
+ }
1721
+ } catch (Exception e) {
1722
+ e.printStackTrace();
1723
+ }
1724
+ }
1725
+ });
1726
+ }
1631
1727
  }
@@ -20,6 +20,8 @@ public class RNLuciqReactnativePackage implements ReactPackage {
20
20
  @NonNull
21
21
  @Override
22
22
  public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
23
+ RNLuciq.getInstance().setCurrentPlatform();
24
+
23
25
  List<NativeModule> modules = new ArrayList<>();
24
26
  modules.add(new RNLuciqReactnativeModule(reactContext));
25
27
  modules.add(new RNLuciqBugReportingModule(reactContext));
@@ -1,6 +1,5 @@
1
1
  package ai.luciq.reactlibrary;
2
2
 
3
- import com.facebook.react.bridge.Callback;
4
3
  import com.facebook.react.bridge.Promise;
5
4
  import com.facebook.react.bridge.ReactApplicationContext;
6
5
  import com.facebook.react.bridge.ReactMethod;
@@ -9,14 +8,13 @@ import com.facebook.react.bridge.ReadableType;
9
8
  import com.facebook.react.bridge.ReadableMapKeySetIterator;
10
9
  import ai.luciq.chat.Replies;
11
10
  import ai.luciq.library.Feature;
12
- import ai.luciq.reactlibrary.utils.EventEmitterModule;
13
11
  import ai.luciq.reactlibrary.utils.MainThreadHandler;
14
12
 
15
13
  import javax.annotation.Nonnull;
16
14
  import java.util.HashMap;
17
15
  import java.util.Map;
18
16
 
19
- public class RNLuciqRepliesModule extends EventEmitterModule {
17
+ public class RNLuciqRepliesModule extends RNLuciqRepliesBaseSpec {
20
18
 
21
19
  public RNLuciqRepliesModule(ReactApplicationContext reactApplicationContext) {
22
20
  super(reactApplicationContext);
@@ -28,16 +26,6 @@ public class RNLuciqRepliesModule extends EventEmitterModule {
28
26
  return "LCQReplies";
29
27
  }
30
28
 
31
- @ReactMethod
32
- public void addListener(String event) {
33
- super.addListener(event);
34
- }
35
-
36
- @ReactMethod
37
- public void removeListeners(Integer count) {
38
- super.removeListeners(count);
39
- }
40
-
41
29
  @ReactMethod
42
30
  public void setEnabled(final boolean isEnabled) {
43
31
  MainThreadHandler.runOnMainThread(new Runnable() {
@@ -222,12 +210,12 @@ public class RNLuciqRepliesModule extends EventEmitterModule {
222
210
  * @param notificationIcon the notification icon resource ID
223
211
  */
224
212
  @ReactMethod
225
- public void setNotificationIcon(final int notificationIcon) {
213
+ public void setNotificationIcon(final double notificationIcon) {
226
214
  MainThreadHandler.runOnMainThread(new Runnable() {
227
215
  @Override
228
216
  public void run() {
229
217
  try {
230
- Replies.setNotificationIcon(notificationIcon);
218
+ Replies.setNotificationIcon((int) notificationIcon);
231
219
  } catch (Exception e) {
232
220
  e.printStackTrace();
233
221
  }
@@ -277,7 +265,7 @@ public class RNLuciqRepliesModule extends EventEmitterModule {
277
265
  }
278
266
 
279
267
  @ReactMethod
280
- public void setOnNewReplyReceivedHandler(final Callback onNewReplyReceivedCallback) {
268
+ public void setOnNewReplyReceivedHandler() {
281
269
  MainThreadHandler.runOnMainThread(new Runnable() {
282
270
  @Override
283
271
  public void run() {
@@ -16,7 +16,6 @@ import ai.luciq.library.OnSessionReplayLinkReady;
16
16
  import ai.luciq.library.SessionSyncListener;
17
17
  import ai.luciq.library.sessionreplay.SessionReplay;
18
18
  import ai.luciq.library.sessionreplay.model.SessionMetadata;
19
- import ai.luciq.reactlibrary.utils.EventEmitterModule;
20
19
  import ai.luciq.reactlibrary.utils.MainThreadHandler;
21
20
  import android.util.Log;
22
21
  import java.util.ArrayList;
@@ -25,22 +24,12 @@ import java.util.concurrent.CountDownLatch;
25
24
 
26
25
  import javax.annotation.Nonnull;
27
26
 
28
- public class RNLuciqSessionReplayModule extends EventEmitterModule {
27
+ public class RNLuciqSessionReplayModule extends RNLuciqSessionReplayBaseSpec {
29
28
 
30
29
  public RNLuciqSessionReplayModule(ReactApplicationContext reactApplicationContext) {
31
30
  super(reactApplicationContext);
32
31
  }
33
32
 
34
- @ReactMethod
35
- public void addListener(String event) {
36
- super.addListener(event);
37
- }
38
-
39
- @ReactMethod
40
- public void removeListeners(Integer count) {
41
- super.removeListeners(count);
42
- }
43
-
44
33
  @Nonnull
45
34
  @Override
46
35
  public String getName() {
@@ -168,7 +157,7 @@ public class RNLuciqSessionReplayModule extends EventEmitterModule {
168
157
  private boolean shouldSync = true;
169
158
  private CountDownLatch latch;
170
159
  @ReactMethod
171
- public void setSyncCallback() {
160
+ public void setSyncCallback(final Promise promise) {
172
161
  MainThreadHandler.runOnMainThread(new Runnable() {
173
162
  @Override
174
163
  public void run() {
@@ -195,7 +184,7 @@ public class RNLuciqSessionReplayModule extends EventEmitterModule {
195
184
  catch(Exception e){
196
185
  e.printStackTrace();
197
186
  }
198
-
187
+ promise.resolve(null);
199
188
  }
200
189
  });
201
190
  }
@@ -248,12 +237,12 @@ public class RNLuciqSessionReplayModule extends EventEmitterModule {
248
237
  }
249
238
 
250
239
  @ReactMethod
251
- public void setScreenshotCaptureInterval(final int intervalMs) {
240
+ public void setScreenshotCaptureInterval(final double intervalMs) {
252
241
  MainThreadHandler.runOnMainThread(new Runnable() {
253
242
  @Override
254
243
  public void run() {
255
244
  try {
256
- SessionReplay.setScreenshotCaptureInterval(intervalMs);
245
+ SessionReplay.setScreenshotCaptureInterval((int) intervalMs);
257
246
  } catch (Exception e) {
258
247
  e.printStackTrace();
259
248
  }
@@ -1,14 +1,12 @@
1
1
  package ai.luciq.reactlibrary;
2
2
 
3
3
  import com.facebook.react.bridge.Arguments;
4
- import com.facebook.react.bridge.Callback;
5
4
  import com.facebook.react.bridge.Promise;
6
5
  import com.facebook.react.bridge.ReactApplicationContext;
7
6
  import com.facebook.react.bridge.ReactMethod;
8
7
  import com.facebook.react.bridge.WritableArray;
9
8
  import ai.luciq.library.Feature;
10
9
  import ai.luciq.reactlibrary.utils.ArrayUtil;
11
- import ai.luciq.reactlibrary.utils.EventEmitterModule;
12
10
  import ai.luciq.reactlibrary.utils.LuciqUtil;
13
11
  import ai.luciq.reactlibrary.utils.MainThreadHandler;
14
12
  import ai.luciq.survey.callbacks.*;
@@ -21,7 +19,7 @@ import java.util.List;
21
19
 
22
20
  import javax.annotation.Nonnull;
23
21
 
24
- public class RNLuciqSurveysModule extends EventEmitterModule {
22
+ public class RNLuciqSurveysModule extends RNLuciqSurveysBaseSpec {
25
23
 
26
24
  public RNLuciqSurveysModule(ReactApplicationContext reactContext) {
27
25
  super(reactContext);
@@ -33,16 +31,6 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
33
31
  return "LCQSurveys";
34
32
  }
35
33
 
36
- @ReactMethod
37
- public void addListener(String event) {
38
- super.addListener(event);
39
- }
40
-
41
- @ReactMethod
42
- public void removeListeners(Integer count) {
43
- super.removeListeners(count);
44
- }
45
-
46
34
  /**
47
35
  * Returns true if the survey with a specific token was answered before.
48
36
  * Will return false if the token does not exist or if the survey was not answered before.
@@ -139,7 +127,7 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
139
127
  * @param handler to run on the UI thread before showing any valid survey
140
128
  */
141
129
  @ReactMethod
142
- public void setOnShowHandler(final Callback handler) {
130
+ public void setOnShowHandler() {
143
131
  MainThreadHandler.runOnMainThread(new Runnable() {
144
132
  @Override
145
133
  public void run() {
@@ -161,7 +149,7 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
161
149
  * @param handler to run on the UI thread after showing any valid survey
162
150
  */
163
151
  @ReactMethod
164
- public void setOnDismissHandler(final Callback handler) {
152
+ public void setOnDismissHandler() {
165
153
  MainThreadHandler.runOnMainThread(new Runnable() {
166
154
  @Override
167
155
  public void run() {
@@ -234,4 +222,8 @@ public class RNLuciqSurveysModule extends EventEmitterModule {
234
222
  }
235
223
  });
236
224
  }
225
+
226
+ @ReactMethod
227
+ public void setAppStoreURL(String appStoreURL) {
228
+ }
237
229
  }
@@ -6,14 +6,7 @@ import com.facebook.react.bridge.ReadableArray;
6
6
  import com.facebook.react.bridge.ReadableMap;
7
7
  import com.facebook.react.bridge.ReadableMapKeySetIterator;
8
8
  import com.facebook.react.bridge.ReadableType;
9
- import com.facebook.react.bridge.WritableArray;
10
- import com.facebook.react.bridge.WritableNativeArray;
11
9
  import ai.luciq.library.model.Report;
12
- import ai.luciq.library.model.a;
13
-
14
- import org.json.JSONException;
15
-
16
- import java.util.ArrayList;
17
10
 
18
11
 
19
12
  /**
@@ -0,0 +1,9 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext;
4
+
5
+ abstract class RNLuciqAPMBaseSpec extends NativeAPMSpec {
6
+ RNLuciqAPMBaseSpec(ReactApplicationContext context) {
7
+ super(context);
8
+ }
9
+ }
@@ -0,0 +1,33 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import androidx.annotation.Nullable;
4
+
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.modules.core.DeviceEventManagerModule;
8
+
9
+ abstract class RNLuciqBaseSpec extends NativeLuciqSpec {
10
+ private int listenerCount = 0;
11
+
12
+ RNLuciqBaseSpec(ReactApplicationContext context) {
13
+ super(context);
14
+ }
15
+
16
+ public void sendEvent(String event, @Nullable ReadableMap params) {
17
+ if (listenerCount > 0) {
18
+ getReactApplicationContext()
19
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
20
+ .emit(event, params);
21
+ }
22
+ }
23
+
24
+ @Override
25
+ public void addListener(String eventName) {
26
+ listenerCount++;
27
+ }
28
+
29
+ @Override
30
+ public void removeListeners(double count) {
31
+ listenerCount = Math.max(0, listenerCount - (int) count);
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import androidx.annotation.Nullable;
4
+
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.modules.core.DeviceEventManagerModule;
8
+
9
+ abstract class RNLuciqBugReportingBaseSpec extends NativeBugReportingSpec {
10
+ private int listenerCount = 0;
11
+
12
+ RNLuciqBugReportingBaseSpec(ReactApplicationContext context) {
13
+ super(context);
14
+ }
15
+
16
+ public void sendEvent(String event, @Nullable ReadableMap params) {
17
+ if (listenerCount > 0) {
18
+ getReactApplicationContext()
19
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
20
+ .emit(event, params);
21
+ }
22
+ }
23
+
24
+ @Override
25
+ public void addListener(String eventName) {
26
+ listenerCount++;
27
+ }
28
+
29
+ @Override
30
+ public void removeListeners(double count) {
31
+ listenerCount = Math.max(0, listenerCount - (int) count);
32
+ }
33
+ }
@@ -0,0 +1,9 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext;
4
+
5
+ abstract class RNLuciqCrashReportingBaseSpec extends NativeCrashReportingSpec {
6
+ RNLuciqCrashReportingBaseSpec(ReactApplicationContext context) {
7
+ super(context);
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext;
4
+
5
+ abstract class RNLuciqFeatureRequestsBaseSpec extends NativeFeatureRequestsSpec {
6
+ RNLuciqFeatureRequestsBaseSpec(ReactApplicationContext context) {
7
+ super(context);
8
+ }
9
+ }
@@ -0,0 +1,33 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import androidx.annotation.Nullable;
4
+
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.modules.core.DeviceEventManagerModule;
8
+
9
+ abstract class RNLuciqNetworkLoggerBaseSpec extends NativeNetworkLoggerSpec {
10
+ private int listenerCount = 0;
11
+
12
+ RNLuciqNetworkLoggerBaseSpec(ReactApplicationContext context) {
13
+ super(context);
14
+ }
15
+
16
+ public void sendEvent(String event, @Nullable ReadableMap params) {
17
+ if (listenerCount > 0) {
18
+ getReactApplicationContext()
19
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
20
+ .emit(event, params);
21
+ }
22
+ }
23
+
24
+ @Override
25
+ public void addListener(String eventName) {
26
+ listenerCount++;
27
+ }
28
+
29
+ @Override
30
+ public void removeListeners(double count) {
31
+ listenerCount = Math.max(0, listenerCount - (int) count);
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import androidx.annotation.Nullable;
4
+
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.modules.core.DeviceEventManagerModule;
8
+
9
+ abstract class RNLuciqRepliesBaseSpec extends NativeRepliesSpec {
10
+ private int listenerCount = 0;
11
+
12
+ RNLuciqRepliesBaseSpec(ReactApplicationContext context) {
13
+ super(context);
14
+ }
15
+
16
+ public void sendEvent(String event, @Nullable ReadableMap params) {
17
+ if (listenerCount > 0) {
18
+ getReactApplicationContext()
19
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
20
+ .emit(event, params);
21
+ }
22
+ }
23
+
24
+ @Override
25
+ public void addListener(String eventName) {
26
+ listenerCount++;
27
+ }
28
+
29
+ @Override
30
+ public void removeListeners(double count) {
31
+ listenerCount = Math.max(0, listenerCount - (int) count);
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import androidx.annotation.Nullable;
4
+
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.modules.core.DeviceEventManagerModule;
8
+
9
+ abstract class RNLuciqSessionReplayBaseSpec extends NativeSessionReplaySpec {
10
+ private int listenerCount = 0;
11
+
12
+ RNLuciqSessionReplayBaseSpec(ReactApplicationContext context) {
13
+ super(context);
14
+ }
15
+
16
+ public void sendEvent(String event, @Nullable ReadableMap params) {
17
+ if (listenerCount > 0) {
18
+ getReactApplicationContext()
19
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
20
+ .emit(event, params);
21
+ }
22
+ }
23
+
24
+ @Override
25
+ public void addListener(String eventName) {
26
+ listenerCount++;
27
+ }
28
+
29
+ @Override
30
+ public void removeListeners(double count) {
31
+ listenerCount = Math.max(0, listenerCount - (int) count);
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import androidx.annotation.Nullable;
4
+
5
+ import com.facebook.react.bridge.ReactApplicationContext;
6
+ import com.facebook.react.bridge.ReadableMap;
7
+ import com.facebook.react.modules.core.DeviceEventManagerModule;
8
+
9
+ abstract class RNLuciqSurveysBaseSpec extends NativeSurveysSpec {
10
+ private int listenerCount = 0;
11
+
12
+ RNLuciqSurveysBaseSpec(ReactApplicationContext context) {
13
+ super(context);
14
+ }
15
+
16
+ public void sendEvent(String event, @Nullable ReadableMap params) {
17
+ if (listenerCount > 0) {
18
+ getReactApplicationContext()
19
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
20
+ .emit(event, params);
21
+ }
22
+ }
23
+
24
+ @Override
25
+ public void addListener(String eventName) {
26
+ listenerCount++;
27
+ }
28
+
29
+ @Override
30
+ public void removeListeners(double count) {
31
+ listenerCount = Math.max(0, listenerCount - (int) count);
32
+ }
33
+ }
@@ -0,0 +1,11 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext;
4
+
5
+ import ai.luciq.reactlibrary.utils.EventEmitterModule;
6
+
7
+ abstract class RNLuciqAPMBaseSpec extends EventEmitterModule {
8
+ RNLuciqAPMBaseSpec(ReactApplicationContext context) {
9
+ super(context);
10
+ }
11
+ }
@@ -0,0 +1,22 @@
1
+ package ai.luciq.reactlibrary;
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext;
4
+ import com.facebook.react.bridge.ReactMethod;
5
+
6
+ import ai.luciq.reactlibrary.utils.EventEmitterModule;
7
+
8
+ abstract class RNLuciqBaseSpec extends EventEmitterModule {
9
+ RNLuciqBaseSpec(ReactApplicationContext context) {
10
+ super(context);
11
+ }
12
+
13
+ @ReactMethod
14
+ public void addListener(String event) {
15
+ super.addListener(event);
16
+ }
17
+
18
+ @ReactMethod
19
+ public void removeListeners(Integer count) {
20
+ super.removeListeners(count);
21
+ }
22
+ }