@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
@@ -0,0 +1,86 @@
1
+ #import "LuciqRepliesBridge.h"
2
+ #import <LuciqSDK/LCQReplies.h>
3
+ #import <asl.h>
4
+ #import <React/RCTLog.h>
5
+ #import <os/log.h>
6
+ #import <LuciqSDK/LCQTypes.h>
7
+ #import <React/RCTUIManager.h>
8
+
9
+ #ifdef RCT_NEW_ARCH_ENABLED
10
+ #import <RNLuciqSpec/RNLuciqSpec.h>
11
+
12
+ @interface LuciqRepliesBridge () <NativeRepliesSpec>
13
+ @end
14
+ #endif
15
+
16
+ @implementation LuciqRepliesBridge
17
+
18
+ - (dispatch_queue_t)methodQueue {
19
+ return dispatch_get_main_queue();
20
+ }
21
+
22
+ + (BOOL)requiresMainQueueSetup
23
+ {
24
+ return NO;
25
+ }
26
+
27
+ - (NSArray<NSString *> *)supportedEvents {
28
+ return @[@"LCQOnNewReplyReceivedCallback"];
29
+ }
30
+
31
+ RCT_EXPORT_MODULE(LCQReplies)
32
+
33
+ RCT_EXPORT_METHOD(setEnabled:(BOOL)isEnabled) {
34
+ LCQReplies.enabled = isEnabled;
35
+ }
36
+
37
+ RCT_EXPORT_METHOD(hasChats:(RCTPromiseResolveBlock)resolve
38
+ reject:(RCTPromiseRejectBlock)reject) {
39
+ resolve(@(LCQReplies.hasChats));
40
+ }
41
+
42
+ RCT_EXPORT_METHOD(show) {
43
+ [[NSRunLoop mainRunLoop] performSelector:@selector(show) target:[LCQReplies class] argument:nil order:0 modes:@[NSDefaultRunLoopMode]];
44
+ }
45
+
46
+ RCT_EXPORT_METHOD(setOnNewReplyReceivedHandler) {
47
+ __weak LuciqRepliesBridge *weakSelf = self;
48
+ LCQReplies.didReceiveReplyHandler = ^{
49
+ [weakSelf sendEventWithName:@"LCQOnNewReplyReceivedCallback" body:nil];
50
+ };
51
+ }
52
+
53
+ RCT_EXPORT_METHOD(getUnreadRepliesCount:(RCTPromiseResolveBlock)resolve
54
+ reject:(RCTPromiseRejectBlock)reject) {
55
+ resolve(@(LCQReplies.unreadRepliesCount));
56
+ }
57
+
58
+ RCT_EXPORT_METHOD(setInAppNotificationEnabled:(BOOL)isChatNotificationEnabled) {
59
+ LCQReplies.inAppNotificationsEnabled = isChatNotificationEnabled;
60
+ }
61
+
62
+ RCT_EXPORT_METHOD(setPushNotificationsEnabled:(BOOL)isPushNotificationEnabled) {
63
+ [LCQReplies setPushNotificationsEnabled:isPushNotificationEnabled];
64
+ }
65
+
66
+ // Android-only methods — iOS no-ops to satisfy the unified spec.
67
+ RCT_EXPORT_METHOD(setInAppNotificationSound:(BOOL)isEnabled) { }
68
+ RCT_EXPORT_METHOD(setPushNotificationRegistrationToken:(NSString *)token) { }
69
+ RCT_EXPORT_METHOD(showNotification:(NSDictionary *)data) { }
70
+ RCT_EXPORT_METHOD(setNotificationIcon:(double)resourceId) { }
71
+ RCT_EXPORT_METHOD(setPushNotificationChannelId:(NSString *)identifier) { }
72
+ RCT_EXPORT_METHOD(setSystemReplyNotificationSoundEnabled:(BOOL)isEnabled) { }
73
+
74
+ #ifdef RCT_NEW_ARCH_ENABLED
75
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
76
+ (const facebook::react::ObjCTurboModule::InitParams &)params
77
+ {
78
+ return std::make_shared<facebook::react::NativeRepliesSpecJSI>(params);
79
+ }
80
+ #endif
81
+
82
+ @synthesize description;
83
+ @synthesize hash;
84
+ @synthesize superclass;
85
+
86
+ @end
@@ -19,17 +19,17 @@
19
19
 
20
20
  - (void)setUserStepsEnabled:(BOOL)isEnabled;
21
21
 
22
- - (void)getSessionReplayLink:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject;
22
+ - (void)getSessionReplayLink:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject;
23
23
 
24
- - (void)setSyncCallback;
24
+ - (void)setSyncCallback:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject;
25
25
 
26
26
  - (void)evaluateSync:(BOOL)result;
27
27
 
28
- - (void)setCapturingMode:(LCQScreenshotCapturingMode)mode;
28
+ - (void)setCapturingMode:(NSString *)mode;
29
29
 
30
- - (void)setScreenshotQuality:(LCQScreenshotQualityMode)quality;
30
+ - (void)setScreenshotQuality:(NSString *)quality;
31
31
 
32
- - (void)setScreenshotCaptureInterval:(NSInteger)intervalMs;
32
+ - (void)setScreenshotCaptureInterval:(double)intervalMs;
33
33
 
34
34
  @property (atomic, copy) SessionEvaluationCompletion sessionEvaluationCompletion;
35
35
 
@@ -6,6 +6,13 @@
6
6
  #import <LuciqSDK/LCQSessionReplay.h>
7
7
  #import "LuciqSessionReplayBridge.h"
8
8
 
9
+ #ifdef RCT_NEW_ARCH_ENABLED
10
+ #import <RNLuciqSpec/RNLuciqSpec.h>
11
+
12
+ @interface LuciqSessionReplayBridge () <NativeSessionReplaySpec>
13
+ @end
14
+ #endif
15
+
9
16
  @implementation LuciqSessionReplayBridge
10
17
 
11
18
  - (dispatch_queue_t)methodQueue {
@@ -41,14 +48,14 @@ RCT_EXPORT_METHOD(setUserStepsEnabled:(BOOL)isEnabled) {
41
48
  LCQSessionReplay.userStepsEnabled = isEnabled;
42
49
  }
43
50
 
44
- RCT_EXPORT_METHOD(getSessionReplayLink:
45
- (RCTPromiseResolveBlock) resolve :(RCTPromiseRejectBlock)reject) {
51
+ RCT_EXPORT_METHOD(getSessionReplayLink:(RCTPromiseResolveBlock)resolve
52
+ reject:(RCTPromiseRejectBlock)reject) {
46
53
  NSString *link = LCQSessionReplay.sessionReplayLink;
47
54
  resolve(link);
48
55
  }
49
56
 
50
57
  - (NSArray<NSDictionary *> *)getNetworkLogsArray:
51
- (NSArray<LCQSessionMetadataNetworkLogs *>*) networkLogs {
58
+ (NSArray<LCQSessionMetadataNetworkLogs *>*)networkLogs {
52
59
  NSMutableArray<NSDictionary *> *networkLogsArray = [NSMutableArray array];
53
60
 
54
61
  for (LCQSessionMetadataNetworkLogs* log in networkLogs) {
@@ -70,49 +77,52 @@ RCT_EXPORT_METHOD(getSessionReplayLink:
70
77
  @"bugsCount": @(metadataObject.bugsCount),
71
78
  @"fatalCrashCount": @(metadataObject.fatalCrashCount),
72
79
  @"oomCrashCount": @(metadataObject.oomCrashCount),
73
- @"networkLogs":[self getNetworkLogsArray:metadataObject.networkLogs]
80
+ @"networkLogs": [self getNetworkLogsArray:metadataObject.networkLogs]
74
81
  };
75
82
  }
76
83
 
77
- RCT_EXPORT_METHOD(setSyncCallback) {
78
- [LCQSessionReplay setSyncCallbackWithHandler:^(LCQSessionMetadata * _Nonnull metadataObject, SessionEvaluationCompletion _Nonnull completion) {
79
-
80
- [self sendEventWithName:@"LCQSessionReplayOnSyncCallback"
81
- body:[self getMetadataObjectMap:metadataObject]];
82
-
83
- self.sessionEvaluationCompletion = completion;
84
+ RCT_EXPORT_METHOD(setSyncCallback:(RCTPromiseResolveBlock)resolve
85
+ reject:(RCTPromiseRejectBlock)reject) {
86
+ __weak LuciqSessionReplayBridge *weakSelf = self;
87
+ [LCQSessionReplay setSyncCallbackWithHandler:^(LCQSessionMetadata * _Nonnull metadataObject, SessionEvaluationCompletion _Nonnull completion) {
88
+ LuciqSessionReplayBridge *strongSelf = weakSelf;
89
+ if (!strongSelf) { return; }
90
+ [strongSelf sendEventWithName:@"LCQSessionReplayOnSyncCallback"
91
+ body:[strongSelf getMetadataObjectMap:metadataObject]];
92
+ strongSelf.sessionEvaluationCompletion = completion;
84
93
  }];
94
+ resolve([NSNull null]);
85
95
  }
86
96
 
87
97
  RCT_EXPORT_METHOD(evaluateSync:(BOOL)result) {
88
-
89
98
  if (self.sessionEvaluationCompletion) {
90
-
91
99
  self.sessionEvaluationCompletion(result);
92
-
93
100
  self.sessionEvaluationCompletion = nil;
94
-
95
101
  }
96
102
  }
97
103
 
98
- RCT_EXPORT_METHOD(setCapturingMode:(LCQScreenshotCapturingMode)mode) {
99
- LCQSessionReplay.screenshotCapturingMode = mode;
104
+ RCT_EXPORT_METHOD(setCapturingMode:(NSString *)mode) {
105
+ LCQSessionReplay.screenshotCapturingMode = (LCQScreenshotCapturingMode)[mode intValue];
100
106
  }
101
107
 
102
- RCT_EXPORT_METHOD(setScreenshotQuality:(LCQScreenshotQualityMode)quality) {
103
- LCQSessionReplay.screenshotQualityMode = quality;
108
+ RCT_EXPORT_METHOD(setScreenshotQuality:(NSString *)quality) {
109
+ LCQSessionReplay.screenshotQualityMode = (LCQScreenshotQualityMode)[quality intValue];
104
110
  }
105
111
 
106
- RCT_EXPORT_METHOD(setScreenshotCaptureInterval:(NSInteger)intervalMs) {
107
- LCQSessionReplay.screenshotCaptureInterval = intervalMs;
112
+ RCT_EXPORT_METHOD(setScreenshotCaptureInterval:(double)intervalMs) {
113
+ LCQSessionReplay.screenshotCaptureInterval = (NSInteger)intervalMs;
108
114
  }
109
115
 
110
- @synthesize description;
116
+ #ifdef RCT_NEW_ARCH_ENABLED
117
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
118
+ (const facebook::react::ObjCTurboModule::InitParams &)params
119
+ {
120
+ return std::make_shared<facebook::react::NativeSessionReplaySpecJSI>(params);
121
+ }
122
+ #endif
111
123
 
124
+ @synthesize description;
112
125
  @synthesize hash;
113
-
114
126
  @synthesize superclass;
115
127
 
116
128
  @end
117
-
118
-
@@ -22,19 +22,19 @@
22
22
 
23
23
  - (void)showSurveysIfAvailable;
24
24
 
25
- - (void)setOnShowHandler:(RCTResponseSenderBlock)callBack;
25
+ - (void)setOnShowHandler;
26
26
 
27
- - (void)setOnDismissHandler:(RCTResponseSenderBlock)callBack;
27
+ - (void)setOnDismissHandler;
28
28
 
29
29
  - (void)setAutoShowingEnabled:(BOOL)autoShowingSurveysEnabled;
30
30
 
31
31
  - (void)setShouldShowWelcomeScreen:(BOOL)shouldShowWelcomeScreen;
32
32
 
33
33
  - (void)hasRespondedToSurvey:(NSString *)surveyToken
34
- :(RCTPromiseResolveBlock)resolve
35
- :(RCTPromiseRejectBlock)reject;
34
+ resolve:(RCTPromiseResolveBlock)resolve
35
+ reject:(RCTPromiseRejectBlock)reject;
36
36
 
37
- - (void)getAvailableSurveys:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject;
37
+ - (void)getAvailableSurveys:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject;
38
38
 
39
39
  - (void)setEnabled:(BOOL)surveysEnabled;
40
40
 
@@ -1,11 +1,3 @@
1
- //
2
- // LuciqSurveysBridge.m
3
- // RNLuciq
4
- //
5
- // Created by Salma Ali on 7/30/19.
6
- // Copyright © 2019 luciq. All rights reserved.
7
- //
8
-
9
1
  #import "LuciqSurveysBridge.h"
10
2
  #import <LuciqSDK/LCQSurveys.h>
11
3
  #import <asl.h>
@@ -14,6 +6,13 @@
14
6
  #import <LuciqSDK/LCQTypes.h>
15
7
  #import <React/RCTUIManager.h>
16
8
 
9
+ #ifdef RCT_NEW_ARCH_ENABLED
10
+ #import <RNLuciqSpec/RNLuciqSpec.h>
11
+
12
+ @interface LuciqSurveysBridge () <NativeSurveysSpec>
13
+ @end
14
+ #endif
15
+
17
16
  @implementation LuciqSurveysBridge
18
17
 
19
18
  - (dispatch_queue_t)methodQueue {
@@ -27,9 +26,9 @@
27
26
 
28
27
  - (NSArray<NSString *> *)supportedEvents {
29
28
  return @[
30
- @"LCQWillShowSurvey",
31
- @"LCQDidDismissSurvey"
32
- ];
29
+ @"LCQWillShowSurvey",
30
+ @"LCQDidDismissSurvey"
31
+ ];
33
32
  }
34
33
 
35
34
  RCT_EXPORT_MODULE(LCQSurveys)
@@ -38,18 +37,21 @@ RCT_EXPORT_METHOD(showSurvey:(NSString *)surveyToken) {
38
37
  [LCQSurveys showSurveyWithToken:surveyToken];
39
38
  }
40
39
 
41
- RCT_EXPORT_METHOD(hasRespondedToSurvey:(NSString *)surveyToken :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
40
+ RCT_EXPORT_METHOD(hasRespondedToSurvey:(NSString *)surveyToken
41
+ resolve:(RCTPromiseResolveBlock)resolve
42
+ reject:(RCTPromiseRejectBlock)reject) {
42
43
  [LCQSurveys hasRespondedToSurveyWithToken:surveyToken
43
44
  completionHandler:^(BOOL hasResponded) {
44
45
  resolve(@(hasResponded));
45
46
  }];
46
47
  }
47
48
 
48
- RCT_EXPORT_METHOD(getAvailableSurveys:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
49
+ RCT_EXPORT_METHOD(getAvailableSurveys:(RCTPromiseResolveBlock)resolve
50
+ reject:(RCTPromiseRejectBlock)reject) {
49
51
  [LCQSurveys availableSurveysWithCompletionHandler:^(NSArray<LCQSurvey *> *availableSurveys) {
50
52
  NSMutableArray<NSDictionary*>* mappedSurveys = [[NSMutableArray alloc] init];
51
53
  for (LCQSurvey* survey in availableSurveys) {
52
- [mappedSurveys addObject:@{@"title": survey.title }];
54
+ [mappedSurveys addObject:@{@"title": survey.title}];
53
55
  }
54
56
  resolve(mappedSurveys);
55
57
  }];
@@ -63,24 +65,18 @@ RCT_EXPORT_METHOD(showSurveysIfAvailable) {
63
65
  [LCQSurveys showSurveyIfAvailable];
64
66
  }
65
67
 
66
- RCT_EXPORT_METHOD(setOnShowHandler:(RCTResponseSenderBlock)callBack) {
67
- if (callBack != nil) {
68
- LCQSurveys.willShowSurveyHandler = ^{
69
- [self sendEventWithName:@"LCQWillShowSurvey" body:nil];
70
- };
71
- } else {
72
- LCQSurveys.willShowSurveyHandler = ^{};
73
- }
68
+ RCT_EXPORT_METHOD(setOnShowHandler) {
69
+ __weak LuciqSurveysBridge *weakSelf = self;
70
+ LCQSurveys.willShowSurveyHandler = ^{
71
+ [weakSelf sendEventWithName:@"LCQWillShowSurvey" body:nil];
72
+ };
74
73
  }
75
74
 
76
- RCT_EXPORT_METHOD(setOnDismissHandler:(RCTResponseSenderBlock)callBack) {
77
- if (callBack != nil) {
78
- LCQSurveys.didDismissSurveyHandler = ^{
79
- [self sendEventWithName:@"LCQDidDismissSurvey" body:nil];
80
- };
81
- } else {
82
- LCQSurveys.didDismissSurveyHandler = ^{};
83
- }
75
+ RCT_EXPORT_METHOD(setOnDismissHandler) {
76
+ __weak LuciqSurveysBridge *weakSelf = self;
77
+ LCQSurveys.didDismissSurveyHandler = ^{
78
+ [weakSelf sendEventWithName:@"LCQDidDismissSurvey" body:nil];
79
+ };
84
80
  }
85
81
 
86
82
  RCT_EXPORT_METHOD(setAutoShowingEnabled:(BOOL)autoShowingSurveysEnabled) {
@@ -95,13 +91,16 @@ RCT_EXPORT_METHOD(setAppStoreURL:(NSString *)appStoreURL) {
95
91
  LCQSurveys.appStoreURL = appStoreURL;
96
92
  }
97
93
 
98
- @synthesize description;
94
+ #ifdef RCT_NEW_ARCH_ENABLED
95
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
96
+ (const facebook::react::ObjCTurboModule::InitParams &)params
97
+ {
98
+ return std::make_shared<facebook::react::NativeSurveysSpecJSI>(params);
99
+ }
100
+ #endif
99
101
 
102
+ @synthesize description;
100
103
  @synthesize hash;
101
-
102
104
  @synthesize superclass;
103
105
 
104
106
  @end
105
-
106
-
107
-
package/ios/native.rb CHANGED
@@ -1,4 +1,4 @@
1
- $luciq= { :version => '19.5.0' }
1
+ $luciq= { :version => '19.5.1' }
2
2
 
3
3
  def use_luciq! (spec = nil)
4
4
  version = $luciq[:version]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@luciq/react-native",
3
3
  "description": "Luciq is the Agentic Observability Platform built for Mobile.",
4
- "version": "19.3.0",
4
+ "version": "19.4.0-44237-SNAPSHOT",
5
5
  "author": "Luciq (https://luciq.ai)",
6
6
  "repository": "github:luciqai/luciq-reactnative-sdk",
7
7
  "homepage": "https://www.luciq.ai/platforms/react-native",
@@ -43,7 +43,6 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@apollo/client": "^3.7.0",
46
- "@instabug/danger-plugin-coverage": "Instabug/danger-plugin-coverage",
47
46
  "@react-native-community/eslint-config": "^3.1.0",
48
47
  "@react-navigation/native": "^6.1.7",
49
48
  "@rollup/plugin-commonjs": "^25.0.3",
@@ -88,5 +87,13 @@
88
87
  "expo": {
89
88
  "optional": true
90
89
  }
90
+ },
91
+ "codegenConfig": {
92
+ "name": "RNLuciqSpec",
93
+ "type": "modules",
94
+ "jsSrcsDir": "src/native/specs",
95
+ "android": {
96
+ "javaPackageName": "ai.luciq.reactlibrary"
97
+ }
91
98
  }
92
99
  }
@@ -47,7 +47,7 @@ export const setOptions = (options: InvocationOption[]) => {
47
47
  */
48
48
  export const onInvokeHandler = (handler: () => void) => {
49
49
  emitter.addListener(NativeEvents.ON_INVOKE_HANDLER, handler);
50
- NativeBugReporting.setOnInvokeHandler(handler);
50
+ NativeBugReporting.setOnInvokeHandler();
51
51
  };
52
52
 
53
53
  /**
@@ -62,7 +62,7 @@ export const onSDKDismissedHandler = (
62
62
  emitter.addListener(NativeEvents.ON_DISMISS_HANDLER, (payload) => {
63
63
  handler(payload.dismissType, payload.reportType);
64
64
  });
65
- NativeBugReporting.setOnSDKDismissedHandler(handler);
65
+ NativeBugReporting.setOnSDKDismissedHandler();
66
66
  };
67
67
 
68
68
  /**
@@ -198,7 +198,7 @@ export const setDidSelectPromptOptionHandler = (handler: (promptOption: string)
198
198
  emitter.addListener(NativeEvents.DID_SELECT_PROMPT_OPTION_HANDLER, (payload) => {
199
199
  handler(payload.promptOption);
200
200
  });
201
- NativeBugReporting.setDidSelectPromptOptionHandler(handler);
201
+ NativeBugReporting.setDidSelectPromptOptionHandler();
202
202
  };
203
203
 
204
204
  /**
@@ -130,6 +130,30 @@ export const setAppVariant = (appVariant: string) => {
130
130
  NativeLuciq.setAppVariant(appVariant);
131
131
  };
132
132
 
133
+ /**
134
+ * Enables or disables WebView monitoring.
135
+ * @param isEnabled A boolean to enable/disable WebView monitoring.
136
+ */
137
+ export const setWebViewMonitoringEnabled = (isEnabled: boolean) => {
138
+ NativeLuciq.setWebViewMonitoringEnabled(isEnabled);
139
+ };
140
+
141
+ /**
142
+ * Enables or disables WebView network tracking.
143
+ * @param isEnabled A boolean to enable/disable WebView network tracking.
144
+ */
145
+ export const setWebViewNetworkTrackingEnabled = (isEnabled: boolean) => {
146
+ NativeLuciq.setWebViewNetworkTrackingEnabled(isEnabled);
147
+ };
148
+
149
+ /**
150
+ * Enables or disables WebView user interactions tracking.
151
+ * @param isEnabled A boolean to enable/disable WebView user interactions tracking.
152
+ */
153
+ export const setWebViewUserInteractionsTrackingEnabled = (isEnabled: boolean) => {
154
+ NativeLuciq.setWebViewUserInteractionsTrackingEnabled(isEnabled);
155
+ };
156
+
133
157
  /**
134
158
  * Handles app state changes and updates APM network flags if necessary.
135
159
  */
@@ -729,7 +753,7 @@ export const onReportSubmitHandler = (handler?: (report: Report) => void) => {
729
753
  handler && handler(reportObj);
730
754
  });
731
755
 
732
- NativeLuciq.setPreSendingHandler(handler);
756
+ NativeLuciq.setPreSendingHandler();
733
757
  };
734
758
 
735
759
  export const onNavigationStateChange = (
@@ -32,7 +32,7 @@ export const show = () => {
32
32
  */
33
33
  export const setOnNewReplyReceivedHandler = (handler: () => void) => {
34
34
  emitter.addListener(NativeEvents.ON_REPLY_RECEIVED_HANDLER, handler);
35
- NativeReplies.setOnNewReplyReceivedHandler(handler);
35
+ NativeReplies.setOnNewReplyReceivedHandler();
36
36
  };
37
37
 
38
38
  /**
@@ -55,7 +55,7 @@ export const setAutoShowingEnabled = (autoShowingSurveysEnabled: boolean) => {
55
55
  */
56
56
  export const setOnShowHandler = (onShowHandler: () => void) => {
57
57
  emitter.addListener(NativeEvents.WILL_SHOW_SURVEY_HANDLER, onShowHandler);
58
- NativeSurveys.setOnShowHandler(onShowHandler);
58
+ NativeSurveys.setOnShowHandler();
59
59
  };
60
60
 
61
61
  /**
@@ -67,7 +67,7 @@ export const setOnShowHandler = (onShowHandler: () => void) => {
67
67
  */
68
68
  export const setOnDismissHandler = (onDismissHandler: () => void) => {
69
69
  emitter.addListener(NativeEvents.DID_DISMISS_SURVEY_HANDLER, onDismissHandler);
70
- NativeSurveys.setOnDismissHandler(onDismissHandler);
70
+ NativeSurveys.setOnDismissHandler();
71
71
  };
72
72
 
73
73
  /**
@@ -1,7 +1,6 @@
1
1
  import { NativeEventEmitter, NativeModule } from 'react-native';
2
2
 
3
3
  import type {
4
- DismissType,
5
4
  ExtendedBugReportMode,
6
5
  FloatingButtonPosition,
7
6
  InvocationEvent,
@@ -44,11 +43,9 @@ export interface BugReportingNativeModule extends NativeModule {
44
43
  setShakingThresholdForAndroid(threshold: number): void;
45
44
 
46
45
  // Callbacks //
47
- setOnInvokeHandler(handler: () => void): void;
48
- setDidSelectPromptOptionHandler(handler: (promptOption: string) => void): void;
49
- setOnSDKDismissedHandler(
50
- handler: (dismissType: DismissType, reportType: ReportType) => void,
51
- ): void;
46
+ setOnInvokeHandler(): void;
47
+ setDidSelectPromptOptionHandler(): void;
48
+ setOnSDKDismissedHandler(): void;
52
49
 
53
50
  addUserConsent(
54
51
  key: string,
@@ -23,10 +23,10 @@ export interface CauseCrashData {
23
23
  }
24
24
  export interface CrashReportingNativeModule extends NativeModule {
25
25
  setEnabled(isEnabled: boolean): void;
26
- sendJSCrash(data: CrashData | string): Promise<void>;
26
+ sendJSCrash(data: CrashData): Promise<void>;
27
27
 
28
28
  sendHandledJSCrash(
29
- data: CrashData | string,
29
+ data: CrashData,
30
30
  userAttributes?: Record<string, string> | null,
31
31
  fingerprint?: string | null,
32
32
  nonFatalExceptionLevel?: NonFatalErrorLevel | null,
@@ -1,6 +1,5 @@
1
1
  import { NativeEventEmitter, NativeModule, ProcessedColorValue } from 'react-native';
2
2
 
3
- import type Report from '../models/Report';
4
3
  import type {
5
4
  AutoMaskingType,
6
5
  ColorTheme,
@@ -138,7 +137,7 @@ export interface LuciqNativeModule extends NativeModule {
138
137
  setFileAttachment(filePath: string, fileName?: string): void;
139
138
 
140
139
  // Report APIs //
141
- setPreSendingHandler(handler?: (report: Report) => void): void;
140
+ setPreSendingHandler(): void;
142
141
  appendTagToReport(tag: string): void;
143
142
  appendConsoleLogToReport(consoleLog: string): void;
144
143
  setUserAttributeToReport(key: string, value: string): void;
@@ -161,12 +160,17 @@ export interface LuciqNativeModule extends NativeModule {
161
160
  // Feature Flags Listener for Android
162
161
  registerFeatureFlagsChangeListener(): void;
163
162
 
164
- setOnFeaturesUpdatedListener(handler?: (params: any) => void): void; // android only
163
+ setOnFeaturesUpdatedListener(): void; // android only
165
164
  enableAutoMasking(autoMaskingTypes: AutoMaskingType[]): void;
166
165
  getNetworkBodyMaxSize(): Promise<number>;
167
166
 
168
167
  setTheme(theme: ThemeConfig): void;
169
168
  setFullscreen(isEnabled: boolean): void;
169
+
170
+ // WebView APIs //
171
+ setWebViewMonitoringEnabled(isEnabled: boolean): void;
172
+ setWebViewNetworkTrackingEnabled(isEnabled: boolean): void;
173
+ setWebViewUserInteractionsTrackingEnabled(isEnabled: boolean): void;
170
174
  }
171
175
 
172
176
  export const NativeLuciq = NativeModules.Luciq as LuciqNativeModule;
@@ -1,4 +1,4 @@
1
- import { NativeModules as ReactNativeModules } from 'react-native';
1
+ import { NativeModules as ReactNativeModules, TurboModuleRegistry } from 'react-native';
2
2
 
3
3
  import type { ApmNativeModule } from './NativeAPM';
4
4
  import type { BugReportingNativeModule } from './NativeBugReporting';
@@ -9,6 +9,15 @@ import type { RepliesNativeModule } from './NativeReplies';
9
9
  import type { SurveysNativeModule } from './NativeSurveys';
10
10
  import type { SessionReplayNativeModule } from './NativeSessionReplay';
11
11
  import type { NetworkLoggerNativeModule } from './NativeNetworkLogger';
12
+ import type { Spec as ApmSpec } from './specs/NativeAPM';
13
+ import type { Spec as BugReportingSpec } from './specs/NativeBugReporting';
14
+ import type { Spec as CrashReportingSpec } from './specs/NativeCrashReporting';
15
+ import type { Spec as FeatureRequestsSpec } from './specs/NativeFeatureRequests';
16
+ import type { Spec as LuciqSpec } from './specs/NativeLuciq';
17
+ import type { Spec as NetworkLoggerSpec } from './specs/NativeNetworkLogger';
18
+ import type { Spec as RepliesSpec } from './specs/NativeReplies';
19
+ import type { Spec as SessionReplaySpec } from './specs/NativeSessionReplay';
20
+ import type { Spec as SurveysSpec } from './specs/NativeSurveys';
12
21
 
13
22
  export interface LuciqNativePackage {
14
23
  LCQAPM: ApmNativeModule;
@@ -22,4 +31,45 @@ export interface LuciqNativePackage {
22
31
  LCQNetworkLogger: NetworkLoggerNativeModule;
23
32
  }
24
33
 
25
- export const NativeModules = ReactNativeModules as LuciqNativePackage;
34
+ const legacy = ReactNativeModules as LuciqNativePackage;
35
+
36
+ function resolve<TSpec, TLegacy>(name: string, fallback: TLegacy): TLegacy {
37
+ return (TurboModuleRegistry.get<TSpec & object>(name) as unknown as TLegacy | null) ?? fallback;
38
+ }
39
+
40
+ const LCQAPM = resolve<ApmSpec, ApmNativeModule>('LCQAPM', legacy.LCQAPM);
41
+ const LCQBugReporting = resolve<BugReportingSpec, BugReportingNativeModule>(
42
+ 'LCQBugReporting',
43
+ legacy.LCQBugReporting,
44
+ );
45
+ const LCQCrashReporting = resolve<CrashReportingSpec, CrashReportingNativeModule>(
46
+ 'LCQCrashReporting',
47
+ legacy.LCQCrashReporting,
48
+ );
49
+ const LCQFeatureRequests = resolve<FeatureRequestsSpec, FeatureRequestsNativeModule>(
50
+ 'LCQFeatureRequests',
51
+ legacy.LCQFeatureRequests,
52
+ );
53
+ const Luciq = resolve<LuciqSpec, LuciqNativeModule>('Luciq', legacy.Luciq);
54
+ const LCQReplies = resolve<RepliesSpec, RepliesNativeModule>('LCQReplies', legacy.LCQReplies);
55
+ const LCQSurveys = resolve<SurveysSpec, SurveysNativeModule>('LCQSurveys', legacy.LCQSurveys);
56
+ const LCQSessionReplay = resolve<SessionReplaySpec, SessionReplayNativeModule>(
57
+ 'LCQSessionReplay',
58
+ legacy.LCQSessionReplay,
59
+ );
60
+ const LCQNetworkLogger = resolve<NetworkLoggerSpec, NetworkLoggerNativeModule>(
61
+ 'LCQNetworkLogger',
62
+ legacy.LCQNetworkLogger,
63
+ );
64
+
65
+ export const NativeModules: LuciqNativePackage = {
66
+ LCQAPM,
67
+ LCQBugReporting,
68
+ LCQCrashReporting,
69
+ LCQFeatureRequests,
70
+ Luciq,
71
+ LCQReplies,
72
+ LCQSurveys,
73
+ LCQSessionReplay,
74
+ LCQNetworkLogger,
75
+ };
@@ -10,7 +10,7 @@ export interface RepliesNativeModule extends NativeModule {
10
10
  getUnreadRepliesCount(): Promise<number>;
11
11
 
12
12
  // Callbacks //
13
- setOnNewReplyReceivedHandler(handler: () => void): void;
13
+ setOnNewReplyReceivedHandler(): void;
14
14
 
15
15
  // Notifications APIs //
16
16
  setPushNotificationsEnabled(isEnabled: boolean): void;
@@ -20,8 +20,8 @@ export interface SurveysNativeModule extends NativeModule {
20
20
  setAppStoreURL(appStoreURL: string): void;
21
21
 
22
22
  // Callbacks //
23
- setOnShowHandler(onShowHandler: () => void): void;
24
- setOnDismissHandler(onDismissHandler: () => void): void;
23
+ setOnShowHandler(): void;
24
+ setOnDismissHandler(): void;
25
25
  }
26
26
 
27
27
  export const NativeSurveys = NativeModules.LCQSurveys;