@luciq/react-native 19.3.0-40271-SNAPSHOT → 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 (119) 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 -12
  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 +29 -56
  11. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +121 -47
  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/EventEmitterModule.java +0 -7
  17. package/android/src/main/java/ai/luciq/reactlibrary/utils/ReportUtil.java +0 -7
  18. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqAPMBaseSpec.java +9 -0
  19. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqBaseSpec.java +33 -0
  20. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqBugReportingBaseSpec.java +33 -0
  21. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqCrashReportingBaseSpec.java +9 -0
  22. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsBaseSpec.java +9 -0
  23. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerBaseSpec.java +33 -0
  24. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqRepliesBaseSpec.java +33 -0
  25. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqSessionReplayBaseSpec.java +33 -0
  26. package/android/src/newarch/java/ai/luciq/reactlibrary/RNLuciqSurveysBaseSpec.java +33 -0
  27. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqAPMBaseSpec.java +11 -0
  28. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqBaseSpec.java +22 -0
  29. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqBugReportingBaseSpec.java +22 -0
  30. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqCrashReportingBaseSpec.java +10 -0
  31. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsBaseSpec.java +10 -0
  32. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerBaseSpec.java +22 -0
  33. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqRepliesBaseSpec.java +22 -0
  34. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqSessionReplayBaseSpec.java +22 -0
  35. package/android/src/oldarch/java/ai/luciq/reactlibrary/RNLuciqSurveysBaseSpec.java +22 -0
  36. package/dist/modules/BugReporting.js +3 -3
  37. package/dist/modules/Luciq.d.ts +15 -0
  38. package/dist/modules/Luciq.js +23 -3
  39. package/dist/modules/NetworkLogger.d.ts +5 -0
  40. package/dist/modules/NetworkLogger.js +1 -9
  41. package/dist/modules/Replies.js +1 -1
  42. package/dist/modules/Surveys.js +2 -2
  43. package/dist/native/NativeBugReporting.d.ts +4 -4
  44. package/dist/native/NativeCrashReporting.d.ts +2 -2
  45. package/dist/native/NativeLuciq.d.ts +5 -3
  46. package/dist/native/NativePackage.js +25 -2
  47. package/dist/native/NativeReplies.d.ts +1 -1
  48. package/dist/native/NativeSurveys.d.ts +2 -2
  49. package/dist/native/specs/NativeAPM.d.ts +21 -0
  50. package/dist/native/specs/NativeAPM.js +2 -0
  51. package/dist/native/specs/NativeBugReporting.d.ts +29 -0
  52. package/dist/native/specs/NativeBugReporting.js +2 -0
  53. package/dist/native/specs/NativeCrashReporting.d.ts +12 -0
  54. package/dist/native/specs/NativeCrashReporting.js +2 -0
  55. package/dist/native/specs/NativeFeatureRequests.d.ts +8 -0
  56. package/dist/native/specs/NativeFeatureRequests.js +2 -0
  57. package/dist/native/specs/NativeLuciq.d.ts +80 -0
  58. package/dist/native/specs/NativeLuciq.js +2 -0
  59. package/dist/native/specs/NativeNetworkLogger.d.ts +16 -0
  60. package/dist/native/specs/NativeNetworkLogger.js +2 -0
  61. package/dist/native/specs/NativeReplies.d.ts +21 -0
  62. package/dist/native/specs/NativeReplies.js +2 -0
  63. package/dist/native/specs/NativeSessionReplay.d.ts +17 -0
  64. package/dist/native/specs/NativeSessionReplay.js +2 -0
  65. package/dist/native/specs/NativeSurveys.d.ts +18 -0
  66. package/dist/native/specs/NativeSurveys.js +2 -0
  67. package/dist/utils/Enums.js +3 -1
  68. package/dist/utils/FeatureFlags.d.ts +0 -6
  69. package/dist/utils/FeatureFlags.js +0 -35
  70. package/dist/utils/LuciqUtils.d.ts +1 -1
  71. package/dist/utils/LuciqUtils.js +0 -9
  72. package/dist/utils/XhrNetworkInterceptor.js +53 -85
  73. package/ios/RNLuciq/LuciqAPMBridge.h +5 -5
  74. package/ios/RNLuciq/{LuciqAPMBridge.m → LuciqAPMBridge.mm} +48 -39
  75. package/ios/RNLuciq/LuciqBugReportingBridge.h +6 -6
  76. package/ios/RNLuciq/LuciqBugReportingBridge.mm +234 -0
  77. package/ios/RNLuciq/LuciqCrashReportingBridge.h +16 -5
  78. package/ios/RNLuciq/LuciqCrashReportingBridge.mm +91 -0
  79. package/ios/RNLuciq/LuciqFeatureRequestsBridge.h +1 -1
  80. package/ios/RNLuciq/{LuciqFeatureRequestsBridge.m → LuciqFeatureRequestsBridge.mm} +21 -16
  81. package/ios/RNLuciq/LuciqNetworkLoggerBridge.h +1 -30
  82. package/ios/RNLuciq/{LuciqNetworkLoggerBridge.m → LuciqNetworkLoggerBridge.mm} +46 -77
  83. package/ios/RNLuciq/LuciqReactBridge.h +13 -13
  84. package/ios/RNLuciq/{LuciqReactBridge.m → LuciqReactBridge.mm} +95 -34
  85. package/ios/RNLuciq/LuciqRepliesBridge.h +3 -3
  86. package/ios/RNLuciq/LuciqRepliesBridge.mm +86 -0
  87. package/ios/RNLuciq/LuciqSessionReplayBridge.h +5 -5
  88. package/ios/RNLuciq/{LuciqSessionReplayBridge.m → LuciqSessionReplayBridge.mm} +35 -25
  89. package/ios/RNLuciq/LuciqSurveysBridge.h +5 -5
  90. package/ios/RNLuciq/{LuciqSurveysBridge.m → LuciqSurveysBridge.mm} +34 -35
  91. package/ios/native.rb +1 -1
  92. package/package.json +9 -1
  93. package/src/modules/BugReporting.ts +3 -3
  94. package/src/modules/Luciq.ts +26 -4
  95. package/src/modules/NetworkLogger.ts +1 -26
  96. package/src/modules/Replies.ts +1 -1
  97. package/src/modules/Surveys.ts +2 -2
  98. package/src/native/NativeBugReporting.ts +3 -6
  99. package/src/native/NativeCrashReporting.ts +2 -2
  100. package/src/native/NativeLuciq.ts +7 -3
  101. package/src/native/NativePackage.ts +52 -2
  102. package/src/native/NativeReplies.ts +1 -1
  103. package/src/native/NativeSurveys.ts +2 -2
  104. package/src/native/specs/NativeAPM.ts +47 -0
  105. package/src/native/specs/NativeBugReporting.ts +53 -0
  106. package/src/native/specs/NativeCrashReporting.ts +23 -0
  107. package/src/native/specs/NativeFeatureRequests.ts +10 -0
  108. package/src/native/specs/NativeLuciq.ts +137 -0
  109. package/src/native/specs/NativeNetworkLogger.ts +31 -0
  110. package/src/native/specs/NativeReplies.ts +27 -0
  111. package/src/native/specs/NativeSessionReplay.ts +20 -0
  112. package/src/native/specs/NativeSurveys.ts +23 -0
  113. package/src/utils/Enums.ts +4 -1
  114. package/src/utils/FeatureFlags.ts +0 -44
  115. package/src/utils/LuciqUtils.ts +1 -21
  116. package/src/utils/XhrNetworkInterceptor.ts +55 -128
  117. package/ios/RNLuciq/LuciqBugReportingBridge.m +0 -249
  118. package/ios/RNLuciq/LuciqCrashReportingBridge.m +0 -68
  119. package/ios/RNLuciq/LuciqRepliesBridge.m +0 -80
@@ -0,0 +1,234 @@
1
+ #import "LuciqBugReportingBridge.h"
2
+ #import <LuciqSDK/LCQBugReporting.h>
3
+ #import <asl.h>
4
+ #import <React/RCTLog.h>
5
+ #import <os/log.h>
6
+ #import <React/RCTUIManager.h>
7
+
8
+ #ifdef RCT_NEW_ARCH_ENABLED
9
+ #import <RNLuciqSpec/RNLuciqSpec.h>
10
+
11
+ @interface LuciqBugReportingBridge () <NativeBugReportingSpec>
12
+ @end
13
+ #endif
14
+
15
+ @implementation LuciqBugReportingBridge
16
+
17
+ - (dispatch_queue_t)methodQueue {
18
+ return dispatch_get_main_queue();
19
+ }
20
+
21
+ + (BOOL)requiresMainQueueSetup
22
+ {
23
+ return NO;
24
+ }
25
+
26
+ - (NSArray<NSString *> *)supportedEvents {
27
+ return @[
28
+ @"LCQpreInvocationHandler",
29
+ @"LCQpostInvocationHandler",
30
+ @"LCQDidSelectPromptOptionHandler",
31
+ ];
32
+ }
33
+
34
+ RCT_EXPORT_MODULE(LCQBugReporting)
35
+
36
+ RCT_EXPORT_METHOD(setEnabled:(BOOL)isEnabled) {
37
+ LCQBugReporting.enabled = isEnabled;
38
+ }
39
+
40
+ RCT_EXPORT_METHOD(setAutoScreenRecordingEnabled:(BOOL)enabled) {
41
+ LCQBugReporting.autoScreenRecordingEnabled = enabled;
42
+ }
43
+
44
+ RCT_EXPORT_METHOD(setAutoScreenRecordingDuration:(double)duration) {
45
+ LCQBugReporting.autoScreenRecordingDuration = duration;
46
+ }
47
+
48
+ RCT_EXPORT_METHOD(setOnInvokeHandler) {
49
+ __weak LuciqBugReportingBridge *weakSelf = self;
50
+ LCQBugReporting.willInvokeHandler = ^{
51
+ [weakSelf sendEventWithName:@"LCQpreInvocationHandler" body:nil];
52
+ };
53
+ }
54
+
55
+ RCT_EXPORT_METHOD(setOnSDKDismissedHandler) {
56
+ __weak LuciqBugReportingBridge *weakSelf = self;
57
+ LCQBugReporting.didDismissHandler = ^(LCQDismissType dismissType, LCQReportCategory reportType) {
58
+ NSString *dismissTypeString;
59
+ if (dismissType == LCQDismissTypeCancel) {
60
+ dismissTypeString = @"CANCEL";
61
+ } else if (dismissType == LCQDismissTypeSubmit) {
62
+ dismissTypeString = @"SUBMIT";
63
+ } else if (dismissType == LCQDismissTypeAddAttachment) {
64
+ dismissTypeString = @"ADD_ATTACHMENT";
65
+ }
66
+
67
+ NSString *reportTypeString;
68
+ if (reportType == LCQReportCategoryBug) {
69
+ reportTypeString = @"bug";
70
+ } else if (reportType == LCQReportCategoryFeedback) {
71
+ reportTypeString = @"feedback";
72
+ } else {
73
+ reportTypeString = @"other";
74
+ }
75
+ NSDictionary *result = @{ @"dismissType": dismissTypeString,
76
+ @"reportType": reportTypeString };
77
+ [weakSelf sendEventWithName:@"LCQpostInvocationHandler" body:result];
78
+ };
79
+ }
80
+
81
+ RCT_EXPORT_METHOD(setDidSelectPromptOptionHandler) {
82
+ __weak LuciqBugReportingBridge *weakSelf = self;
83
+ LCQBugReporting.didSelectPromptOptionHandler = ^(LCQPromptOption promptOption) {
84
+ NSString *promptOptionString;
85
+ if (promptOption == LCQPromptOptionBug) {
86
+ promptOptionString = @"bug";
87
+ } else if (promptOption == LCQBugReportingTypeFeedback) {
88
+ promptOptionString = @"feedback";
89
+ } else if (promptOption == LCQPromptOptionChat) {
90
+ promptOptionString = @"chat";
91
+ } else {
92
+ promptOptionString = @"none";
93
+ }
94
+ [weakSelf sendEventWithName:@"LCQDidSelectPromptOptionHandler"
95
+ body:@{@"promptOption": promptOptionString}];
96
+ };
97
+ }
98
+
99
+ RCT_EXPORT_METHOD(setInvocationEvents:(NSArray *)invocationEventsArray) {
100
+ LCQInvocationEvent invocationEvents = 0;
101
+ for (id value in invocationEventsArray) {
102
+ invocationEvents |= [value intValue];
103
+ }
104
+ LCQBugReporting.invocationEvents = invocationEvents;
105
+ }
106
+
107
+ RCT_EXPORT_METHOD(setOptions:(NSArray *)invocationOptionsArray) {
108
+ LCQBugReportingOption invocationOptions = 0;
109
+ for (id value in invocationOptionsArray) {
110
+ invocationOptions |= [value intValue];
111
+ }
112
+ LCQBugReporting.bugReportingOptions = invocationOptions;
113
+ }
114
+
115
+ RCT_EXPORT_METHOD(setFloatingButtonEdge:(NSString *)edge offset:(double)offset) {
116
+ LCQBugReporting.floatingButtonEdge = (CGRectEdge)[edge intValue];
117
+ LCQBugReporting.floatingButtonTopOffset = offset;
118
+ }
119
+
120
+ RCT_EXPORT_METHOD(setExtendedBugReportMode:(NSString *)mode) {
121
+ LCQBugReporting.extendedBugReportMode = (LCQExtendedBugReportMode)[mode intValue];
122
+ }
123
+
124
+ RCT_EXPORT_METHOD(setEnabledAttachmentTypes:(BOOL)screenshot
125
+ extraScreenshot:(BOOL)extraScreenshot
126
+ galleryImage:(BOOL)galleryImage
127
+ screenRecording:(BOOL)screenRecording) {
128
+ LCQAttachmentType attachmentTypes = 0;
129
+ if (screenshot) attachmentTypes = LCQAttachmentTypeScreenShot;
130
+ if (extraScreenshot) attachmentTypes |= LCQAttachmentTypeExtraScreenShot;
131
+ if (galleryImage) attachmentTypes |= LCQAttachmentTypeGalleryImage;
132
+ if (screenRecording) attachmentTypes |= LCQAttachmentTypeScreenRecording;
133
+
134
+ LCQBugReporting.enabledAttachmentTypes = attachmentTypes;
135
+ }
136
+
137
+ RCT_EXPORT_METHOD(setViewHierarchyEnabled:(BOOL)viewHierarchyEnabled) {
138
+ LCQBugReporting.shouldCaptureViewHierarchy = viewHierarchyEnabled;
139
+ }
140
+
141
+ RCT_EXPORT_METHOD(setVideoRecordingFloatingButtonPosition:(NSString *)position) {
142
+ LCQBugReporting.videoRecordingFloatingButtonPosition = (LCQPosition)[position intValue];
143
+ }
144
+
145
+ RCT_EXPORT_METHOD(setReportTypes:(NSArray *)types) {
146
+ LCQBugReportingReportType reportTypes = 0;
147
+ for (id value in types) {
148
+ reportTypes |= [value intValue];
149
+ }
150
+ [LCQBugReporting setPromptOptionsEnabledReportTypes:reportTypes];
151
+ }
152
+
153
+ RCT_EXPORT_METHOD(show:(NSString *)type options:(NSArray *)options) {
154
+ LCQBugReportingOption parsedOptions = 0;
155
+ for (id value in options) {
156
+ parsedOptions |= [value intValue];
157
+ }
158
+ NSArray *args = @[@([type intValue]), @(parsedOptions)];
159
+ [[NSRunLoop mainRunLoop] performSelector:@selector(showBugReportingWithReportTypeAndOptionsHelper:)
160
+ target:self
161
+ argument:args
162
+ order:0
163
+ modes:@[NSDefaultRunLoopMode]];
164
+ }
165
+
166
+ - (void)showBugReportingWithReportTypeAndOptionsHelper:(NSArray *)args {
167
+ LCQBugReportingReportType parsedReportType = [args[0] intValue];
168
+ LCQBugReportingOption parsedOptions = [args[1] intValue];
169
+ [LCQBugReporting showWithReportType:parsedReportType options:parsedOptions];
170
+ }
171
+
172
+ RCT_EXPORT_METHOD(setShakingThresholdForiPhone:(double)iPhoneShakingThreshold) {
173
+ LCQBugReporting.shakingThresholdForiPhone = iPhoneShakingThreshold;
174
+ }
175
+
176
+ RCT_EXPORT_METHOD(setShakingThresholdForiPad:(double)iPadShakingThreshold) {
177
+ LCQBugReporting.shakingThresholdForiPad = iPadShakingThreshold;
178
+ }
179
+
180
+ RCT_EXPORT_METHOD(setDisclaimerText:(NSString *)text) {
181
+ [LCQBugReporting setDisclaimerText:text];
182
+ }
183
+
184
+ RCT_EXPORT_METHOD(setCommentMinimumCharacterCount:(double)limit reportTypes:(NSArray *)reportTypes) {
185
+ LCQBugReportingType parsedReportTypes = 0;
186
+ if (![reportTypes count]) {
187
+ parsedReportTypes = LCQBugReportingTypeBug | LCQBugReportingTypeFeedback | LCQBugReportingTypeQuestion;
188
+ } else {
189
+ for (id value in reportTypes) {
190
+ parsedReportTypes |= [value intValue];
191
+ }
192
+ }
193
+ [LCQBugReporting setCommentMinimumCharacterCount:(NSInteger)limit forBugReportType:parsedReportTypes];
194
+ }
195
+
196
+ RCT_EXPORT_METHOD(addUserConsent:(NSString *)key
197
+ description:(NSString *)description
198
+ mandatory:(BOOL)mandatory
199
+ checked:(BOOL)checked
200
+ actionType:(NSString * _Nullable)actionType) {
201
+ LCQConsentAction mappedActionType = (LCQConsentAction)[actionType integerValue];
202
+ [LCQBugReporting addUserConsentWithKey:key
203
+ description:description
204
+ mandatory:mandatory
205
+ checked:checked
206
+ actionType:mappedActionType];
207
+ }
208
+
209
+ RCT_EXPORT_METHOD(setProactiveReportingConfigurations:(BOOL)enabled
210
+ gapBetweenModals:(double)gapBetweenModals
211
+ modalDelayAfterDetection:(double)modalDelayAfterDetection) {
212
+ LCQProactiveReportingConfigurations *configurations = [[LCQProactiveReportingConfigurations alloc] init];
213
+ configurations.enabled = enabled;
214
+ configurations.gapBetweenModals = @(gapBetweenModals);
215
+ configurations.modalDelayAfterDetection = @(modalDelayAfterDetection);
216
+ [LCQBugReporting setProactiveReportingConfigurations:configurations];
217
+ }
218
+
219
+ // Android-only method — iOS no-op.
220
+ RCT_EXPORT_METHOD(setShakingThresholdForAndroid:(double)threshold) { }
221
+
222
+ #ifdef RCT_NEW_ARCH_ENABLED
223
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
224
+ (const facebook::react::ObjCTurboModule::InitParams &)params
225
+ {
226
+ return std::make_shared<facebook::react::NativeBugReportingSpecJSI>(params);
227
+ }
228
+ #endif
229
+
230
+ @synthesize description;
231
+ @synthesize hash;
232
+ @synthesize superclass;
233
+
234
+ @end
@@ -9,10 +9,21 @@
9
9
 
10
10
  @interface LuciqCrashReportingBridge : RCTEventEmitter <RCTBridgeModule>
11
11
 
12
- - (void)setEnabled:(BOOL) isEnabled;
13
- - (void)sendJSCrash:(NSDictionary *_Nonnull )stackTrace resolver:(RCTPromiseResolveBlock _Nullable )resolve
14
- rejecter:(RCTPromiseRejectBlock _Nullable )reject;
15
- - (void)sendHandledJSCrash:(NSDictionary *_Nonnull)stackTrace userAttributes:(nullable NSDictionary *)userAttributes fingerprint:(nullable NSString *)fingerprint nonFatalExceptionLevel:(LCQNonFatalLevel) nonFatalExceptionLevel resolver:(RCTPromiseResolveBlock _Nullable )resolve
16
- rejecter:(RCTPromiseRejectBlock _Nullable )reject;
12
+ - (void)setEnabled:(BOOL)isEnabled;
13
+
14
+ - (void)sendJSCrash:(NSDictionary * _Nonnull)data
15
+ resolve:(RCTPromiseResolveBlock _Nullable)resolve
16
+ reject:(RCTPromiseRejectBlock _Nullable)reject;
17
+
18
+ - (void)sendHandledJSCrash:(NSDictionary * _Nonnull)data
19
+ userAttributes:(NSDictionary * _Nullable)userAttributes
20
+ fingerprint:(NSString * _Nullable)fingerprint
21
+ nonFatalExceptionLevel:(NSString * _Nullable)nonFatalExceptionLevel
22
+ resolve:(RCTPromiseResolveBlock _Nullable)resolve
23
+ reject:(RCTPromiseRejectBlock _Nullable)reject;
24
+
25
+ - (void)setNDKCrashesEnabled:(BOOL)isEnabled
26
+ resolve:(RCTPromiseResolveBlock _Nullable)resolve
27
+ reject:(RCTPromiseRejectBlock _Nullable)reject;
17
28
 
18
29
  @end
@@ -0,0 +1,91 @@
1
+ #import "LuciqCrashReportingBridge.h"
2
+ #import "Util/LCQCrashReporting+CP.h"
3
+
4
+ #ifdef RCT_NEW_ARCH_ENABLED
5
+ #import <RNLuciqSpec/RNLuciqSpec.h>
6
+
7
+ @interface LuciqCrashReportingBridge () <NativeCrashReportingSpec>
8
+ @end
9
+ #endif
10
+
11
+ @implementation LuciqCrashReportingBridge
12
+
13
+ - (dispatch_queue_t)methodQueue {
14
+ return dispatch_get_main_queue();
15
+ }
16
+
17
+ + (BOOL)requiresMainQueueSetup
18
+ {
19
+ return NO;
20
+ }
21
+
22
+ - (NSArray<NSString *> *)supportedEvents {
23
+ return @[
24
+ @"LCQSendHandledJSCrash",
25
+ @"LCQSendUnhandledJSCrash",
26
+ ];
27
+ }
28
+
29
+ RCT_EXPORT_MODULE(LCQCrashReporting)
30
+
31
+ RCT_EXPORT_METHOD(setEnabled:(BOOL)isEnabled) {
32
+ LCQCrashReporting.enabled = isEnabled;
33
+ }
34
+
35
+ RCT_EXPORT_METHOD(sendJSCrash:(NSDictionary *)data
36
+ resolve:(RCTPromiseResolveBlock)resolve
37
+ reject:(RCTPromiseRejectBlock)reject) {
38
+ dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul);
39
+ dispatch_async(queue, ^{
40
+ [LCQCrashReporting cp_reportFatalCrashWithStackTrace:data];
41
+ resolve([NSNull null]);
42
+ });
43
+ }
44
+
45
+ RCT_EXPORT_METHOD(sendHandledJSCrash:(NSDictionary *)data
46
+ userAttributes:(nullable NSDictionary *)userAttributes
47
+ fingerprint:(nullable NSString *)fingerprint
48
+ nonFatalExceptionLevel:(nullable NSString *)nonFatalExceptionLevel
49
+ resolve:(RCTPromiseResolveBlock)resolve
50
+ reject:(RCTPromiseRejectBlock)reject) {
51
+ if ([fingerprint isKindOfClass:NSNull.class]) {
52
+ fingerprint = nil;
53
+ }
54
+ if ([userAttributes isKindOfClass:NSNull.class]) {
55
+ userAttributes = nil;
56
+ }
57
+
58
+ LCQNonFatalLevel level = LCQNonFatalLevelError;
59
+ if (nonFatalExceptionLevel != nil && ![nonFatalExceptionLevel isKindOfClass:NSNull.class]) {
60
+ level = (LCQNonFatalLevel)[nonFatalExceptionLevel intValue];
61
+ }
62
+
63
+ dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
64
+ dispatch_async(queue, ^{
65
+ [LCQCrashReporting cp_reportNonFatalCrashWithStackTrace:data
66
+ level:level
67
+ groupingString:fingerprint
68
+ userAttributes:userAttributes];
69
+ resolve([NSNull null]);
70
+ });
71
+ }
72
+
73
+ RCT_EXPORT_METHOD(setNDKCrashesEnabled:(BOOL)isEnabled
74
+ resolve:(RCTPromiseResolveBlock)resolve
75
+ reject:(RCTPromiseRejectBlock)reject) {
76
+ resolve([NSNull null]);
77
+ }
78
+
79
+ #ifdef RCT_NEW_ARCH_ENABLED
80
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
81
+ (const facebook::react::ObjCTurboModule::InitParams &)params
82
+ {
83
+ return std::make_shared<facebook::react::NativeCrashReportingSpecJSI>(params);
84
+ }
85
+ #endif
86
+
87
+ @synthesize description;
88
+ @synthesize hash;
89
+ @synthesize superclass;
90
+
91
+ @end
@@ -18,7 +18,7 @@
18
18
  +------------------------------------------------------------------------+
19
19
  */
20
20
 
21
- - (void)setEmailFieldRequiredForFeatureRequests:(BOOL)isEmailFieldRequired forAction:(NSArray *)actionTypesArray;
21
+ - (void)setEmailFieldRequiredForFeatureRequests:(BOOL)isEmailFieldRequired types:(NSArray *)actionTypesArray;
22
22
 
23
23
  - (void)show;
24
24
 
@@ -1,11 +1,3 @@
1
- //
2
- // LuciqFeatureRequestsBridge.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 "LuciqFeatureRequestsBridge.h"
10
2
  #import <LuciqSDK/LCQFeatureRequests.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 LuciqFeatureRequestsBridge () <NativeFeatureRequestsSpec>
13
+ @end
14
+ #endif
15
+
17
16
  @implementation LuciqFeatureRequestsBridge
18
17
 
19
18
  - (dispatch_queue_t)methodQueue {
@@ -36,26 +35,32 @@ RCT_EXPORT_METHOD(show) {
36
35
  }
37
36
 
38
37
  RCT_EXPORT_METHOD(setEmailFieldRequiredForFeatureRequests:(BOOL)isEmailFieldRequired
39
- forAction:(NSArray *)actionTypesArray) {
38
+ types:(NSArray *)actionTypesArray) {
40
39
  LCQAction actionTypes = 0;
41
40
 
42
- for (NSNumber *boxedValue in actionTypesArray) {
43
- actionTypes |= [boxedValue intValue];
41
+ for (id value in actionTypesArray) {
42
+ if ([value isKindOfClass:[NSNumber class]] || [value isKindOfClass:[NSString class]]) {
43
+ actionTypes |= [value intValue];
44
+ }
44
45
  }
45
46
 
46
47
  [LCQFeatureRequests setEmailFieldRequired:isEmailFieldRequired forAction:actionTypes];
47
48
  }
48
49
 
49
- RCT_EXPORT_METHOD(setEnabled: (BOOL) isEnabled) {
50
+ RCT_EXPORT_METHOD(setEnabled:(BOOL)isEnabled) {
50
51
  LCQFeatureRequests.enabled = isEnabled;
51
52
  }
52
53
 
53
- @synthesize description;
54
+ #ifdef RCT_NEW_ARCH_ENABLED
55
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
56
+ (const facebook::react::ObjCTurboModule::InitParams &)params
57
+ {
58
+ return std::make_shared<facebook::react::NativeFeatureRequestsSpecJSI>(params);
59
+ }
60
+ #endif
54
61
 
62
+ @synthesize description;
55
63
  @synthesize hash;
56
-
57
64
  @synthesize superclass;
58
65
 
59
66
  @end
60
-
61
-
@@ -2,15 +2,9 @@
2
2
  #import <React/RCTEventEmitter.h>
3
3
  #import <LuciqSDK/LCQTypes.h>
4
4
 
5
- typedef void (^ LCQURLRequestAsyncObfuscationCompletedHandler)(NSURLRequest * _Nonnull request);
5
+ typedef void (^LCQURLRequestAsyncObfuscationCompletedHandler)(NSURLRequest * _Nonnull request);
6
6
  typedef void (^LCQURLRequestResponseAsyncFilteringCompletedHandler)(BOOL keep);
7
7
 
8
- typedef NS_ENUM(NSInteger, NetworkListenerType) {
9
- NetworkListenerTypeFiltering,
10
- NetworkListenerTypeObfuscation,
11
- NetworkListenerTypeBoth
12
- };
13
-
14
8
  @interface LuciqNetworkLoggerBridge : RCTEventEmitter <RCTBridgeModule>
15
9
 
16
10
  @property NSMutableDictionary<NSString *, LCQURLRequestAsyncObfuscationCompletedHandler> * _Nonnull requestObfuscationCompletionDictionary;
@@ -18,27 +12,4 @@ typedef NS_ENUM(NSInteger, NetworkListenerType) {
18
12
  @property NSMutableDictionary<NSString *, LCQURLRequestResponseAsyncFilteringCompletedHandler> * _Nonnull requestFilteringCompletionDictionary;
19
13
  @property NSMutableDictionary<NSString *, LCQURLRequestResponseAsyncFilteringCompletedHandler> * _Nonnull responseFilteringCompletionDictionary;
20
14
 
21
- /*
22
- +------------------------------------------------------------------------+
23
- | NetworkLogger Module |
24
- +------------------------------------------------------------------------+
25
- */
26
-
27
- - (BOOL)isNativeInterceptionEnabled;
28
-
29
- - (void) registerNetworkLogsListener:(NetworkListenerType)listenerType;
30
-
31
- - (void)updateNetworkLogSnapshot:(NSString * _Nonnull)url
32
- callbackID:(NSString * _Nonnull)callbackID
33
- requestBody:(NSString * _Nullable)requestBody
34
- responseBody:(NSString * _Nullable)responseBody
35
- responseCode:(double)responseCode
36
- requestHeaders:(NSDictionary * _Nullable)requestHeaders
37
- responseHeaders:(NSDictionary * _Nullable)responseHeaders;
38
-
39
- - (void) setNetworkLoggingRequestFilterPredicateIOS:(NSString * _Nonnull) callbackID : (BOOL)value;
40
-
41
- - (void)forceStartNetworkLoggingIOS;
42
-
43
- - (void)forceStopNetworkLoggingIOS;
44
15
  @end