@luciq/react-native 18.0.0

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 (239) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/FONTS_SETUP_GUIDE.md +521 -0
  3. package/Gemfile +1 -0
  4. package/Gemfile.lock +11 -0
  5. package/LICENSE +21 -0
  6. package/README.md +148 -0
  7. package/RNLuciq.podspec +21 -0
  8. package/android/build.gradle +88 -0
  9. package/android/gradle.properties +4 -0
  10. package/android/jacoco.gradle +52 -0
  11. package/android/native.gradle +7 -0
  12. package/android/proguard-rules.txt +1 -0
  13. package/android/sourcemaps.gradle +255 -0
  14. package/android/src/main/AndroidManifest.xml +4 -0
  15. package/android/src/main/java/ai/luciq/reactlibrary/ArgsRegistry.java +278 -0
  16. package/android/src/main/java/ai/luciq/reactlibrary/Constants.java +20 -0
  17. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciq.java +328 -0
  18. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +392 -0
  19. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqBugReportingModule.java +444 -0
  20. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqCrashReportingModule.java +169 -0
  21. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsModule.java +98 -0
  22. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerModule.java +195 -0
  23. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +1611 -0
  24. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativePackage.java +41 -0
  25. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqRepliesModule.java +298 -0
  26. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +213 -0
  27. package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSurveysModule.java +237 -0
  28. package/android/src/main/java/ai/luciq/reactlibrary/utils/ArrayUtil.java +167 -0
  29. package/android/src/main/java/ai/luciq/reactlibrary/utils/EventEmitterModule.java +35 -0
  30. package/android/src/main/java/ai/luciq/reactlibrary/utils/LuciqUtil.java +58 -0
  31. package/android/src/main/java/ai/luciq/reactlibrary/utils/MainThreadHandler.java +13 -0
  32. package/android/src/main/java/ai/luciq/reactlibrary/utils/MapUtil.java +171 -0
  33. package/android/src/main/java/ai/luciq/reactlibrary/utils/RNTouchedViewExtractor.java +167 -0
  34. package/android/src/main/java/ai/luciq/reactlibrary/utils/ReportUtil.java +67 -0
  35. package/app.plugin.js +1 -0
  36. package/babel.config.js +3 -0
  37. package/bin/commands/MigrateCommand.d.ts +6 -0
  38. package/bin/commands/UploadEasUpdatesSourcemaps.d.ts +2 -0
  39. package/bin/commands/UploadSoFiles.d.ts +6 -0
  40. package/bin/commands/UploadSourcemaps.d.ts +2 -0
  41. package/bin/config/migration-config.json +125 -0
  42. package/bin/index.d.ts +2 -0
  43. package/bin/index.js +19179 -0
  44. package/bin/upload/index.d.ts +4 -0
  45. package/bin/upload/migrate.d.ts +14 -0
  46. package/bin/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
  47. package/bin/upload/uploadSoFiles.d.ts +21 -0
  48. package/bin/upload/uploadSourcemaps.d.ts +21 -0
  49. package/cli/commands/MigrateCommand.ts +32 -0
  50. package/cli/commands/UploadEasUpdatesSourcemaps.ts +34 -0
  51. package/cli/commands/UploadSoFiles.ts +38 -0
  52. package/cli/commands/UploadSourcemaps.ts +40 -0
  53. package/cli/config/migration-config.json +125 -0
  54. package/cli/index.ts +21 -0
  55. package/cli/upload/index.ts +4 -0
  56. package/cli/upload/migrate.ts +271 -0
  57. package/cli/upload/uploadEasUpdatesSourcemaps.ts +74 -0
  58. package/cli/upload/uploadSoFiles.ts +112 -0
  59. package/cli/upload/uploadSourcemaps.ts +73 -0
  60. package/dangerfile.ts +44 -0
  61. package/dist/index.d.ts +19 -0
  62. package/dist/index.js +14 -0
  63. package/dist/models/FeatureFlag.d.ts +11 -0
  64. package/dist/models/FeatureFlag.js +1 -0
  65. package/dist/models/LuciqConfig.d.ts +42 -0
  66. package/dist/models/LuciqConfig.js +1 -0
  67. package/dist/models/NonFatalOptions.d.ts +15 -0
  68. package/dist/models/NonFatalOptions.js +1 -0
  69. package/dist/models/OverAirUpdate.d.ts +12 -0
  70. package/dist/models/OverAirUpdate.js +1 -0
  71. package/dist/models/Report.d.ts +70 -0
  72. package/dist/models/Report.js +109 -0
  73. package/dist/models/ReproConfig.d.ts +27 -0
  74. package/dist/models/ReproConfig.js +1 -0
  75. package/dist/models/SessionMetadata.d.ts +55 -0
  76. package/dist/models/SessionMetadata.js +1 -0
  77. package/dist/models/ThemeConfig.d.ts +27 -0
  78. package/dist/models/ThemeConfig.js +1 -0
  79. package/dist/models/W3cExternalTraceAttributes.d.ts +22 -0
  80. package/dist/models/W3cExternalTraceAttributes.js +1 -0
  81. package/dist/modules/APM.d.ts +77 -0
  82. package/dist/modules/APM.js +104 -0
  83. package/dist/modules/BugReporting.d.ts +138 -0
  84. package/dist/modules/BugReporting.js +202 -0
  85. package/dist/modules/CrashReporting.d.ts +19 -0
  86. package/dist/modules/CrashReporting.js +40 -0
  87. package/dist/modules/FeatureRequests.d.ts +20 -0
  88. package/dist/modules/FeatureRequests.js +28 -0
  89. package/dist/modules/Luciq.d.ts +362 -0
  90. package/dist/modules/Luciq.js +797 -0
  91. package/dist/modules/NetworkLogger.d.ts +52 -0
  92. package/dist/modules/NetworkLogger.js +208 -0
  93. package/dist/modules/Replies.d.ts +78 -0
  94. package/dist/modules/Replies.js +121 -0
  95. package/dist/modules/SessionReplay.d.ts +78 -0
  96. package/dist/modules/SessionReplay.js +98 -0
  97. package/dist/modules/Surveys.d.ts +75 -0
  98. package/dist/modules/Surveys.js +101 -0
  99. package/dist/native/NativeAPM.d.ts +18 -0
  100. package/dist/native/NativeAPM.js +4 -0
  101. package/dist/native/NativeBugReporting.d.ts +32 -0
  102. package/dist/native/NativeBugReporting.js +10 -0
  103. package/dist/native/NativeConstants.d.ts +182 -0
  104. package/dist/native/NativeConstants.js +1 -0
  105. package/dist/native/NativeCrashReporting.d.ts +18 -0
  106. package/dist/native/NativeCrashReporting.js +2 -0
  107. package/dist/native/NativeFeatureRequests.d.ts +8 -0
  108. package/dist/native/NativeFeatureRequests.js +2 -0
  109. package/dist/native/NativeLuciq.d.ts +86 -0
  110. package/dist/native/NativeLuciq.js +10 -0
  111. package/dist/native/NativeNetworkLogger.d.ts +21 -0
  112. package/dist/native/NativeNetworkLogger.js +14 -0
  113. package/dist/native/NativePackage.d.ts +21 -0
  114. package/dist/native/NativePackage.js +2 -0
  115. package/dist/native/NativeReplies.d.ts +21 -0
  116. package/dist/native/NativeReplies.js +8 -0
  117. package/dist/native/NativeSessionReplay.d.ts +16 -0
  118. package/dist/native/NativeSessionReplay.js +8 -0
  119. package/dist/native/NativeSurveys.d.ts +22 -0
  120. package/dist/native/NativeSurveys.js +9 -0
  121. package/dist/utils/AppStatesHandler.d.ts +3 -0
  122. package/dist/utils/AppStatesHandler.js +16 -0
  123. package/dist/utils/Enums.d.ts +244 -0
  124. package/dist/utils/Enums.js +266 -0
  125. package/dist/utils/FeatureFlags.d.ts +7 -0
  126. package/dist/utils/FeatureFlags.js +24 -0
  127. package/dist/utils/LuciqConstants.d.ts +14 -0
  128. package/dist/utils/LuciqConstants.js +15 -0
  129. package/dist/utils/LuciqUtils.d.ts +97 -0
  130. package/dist/utils/LuciqUtils.js +301 -0
  131. package/dist/utils/UnhandledRejectionTracking.d.ts +9 -0
  132. package/dist/utils/UnhandledRejectionTracking.js +99 -0
  133. package/dist/utils/XhrNetworkInterceptor.d.ts +39 -0
  134. package/dist/utils/XhrNetworkInterceptor.js +253 -0
  135. package/dist/utils/config.d.ts +5 -0
  136. package/dist/utils/config.js +6 -0
  137. package/dist/utils/logger.d.ts +10 -0
  138. package/dist/utils/logger.js +39 -0
  139. package/expo.d.ts +1 -0
  140. package/expo.js +1 -0
  141. package/ios/RNLuciq/ArgsRegistry.h +32 -0
  142. package/ios/RNLuciq/ArgsRegistry.m +276 -0
  143. package/ios/RNLuciq/LuciqAPMBridge.h +26 -0
  144. package/ios/RNLuciq/LuciqAPMBridge.m +99 -0
  145. package/ios/RNLuciq/LuciqBugReportingBridge.h +60 -0
  146. package/ios/RNLuciq/LuciqBugReportingBridge.m +241 -0
  147. package/ios/RNLuciq/LuciqCrashReportingBridge.h +18 -0
  148. package/ios/RNLuciq/LuciqCrashReportingBridge.m +68 -0
  149. package/ios/RNLuciq/LuciqFeatureRequestsBridge.h +30 -0
  150. package/ios/RNLuciq/LuciqFeatureRequestsBridge.m +61 -0
  151. package/ios/RNLuciq/LuciqNetworkLoggerBridge.h +44 -0
  152. package/ios/RNLuciq/LuciqNetworkLoggerBridge.m +206 -0
  153. package/ios/RNLuciq/LuciqReactBridge.h +151 -0
  154. package/ios/RNLuciq/LuciqReactBridge.m +548 -0
  155. package/ios/RNLuciq/LuciqRepliesBridge.h +40 -0
  156. package/ios/RNLuciq/LuciqRepliesBridge.m +80 -0
  157. package/ios/RNLuciq/LuciqSessionReplayBridge.h +32 -0
  158. package/ios/RNLuciq/LuciqSessionReplayBridge.m +107 -0
  159. package/ios/RNLuciq/LuciqSurveysBridge.h +46 -0
  160. package/ios/RNLuciq/LuciqSurveysBridge.m +107 -0
  161. package/ios/RNLuciq/RCTConvert+LuciqEnums.h +18 -0
  162. package/ios/RNLuciq/RCTConvert+LuciqEnums.m +127 -0
  163. package/ios/RNLuciq/RNLuciq.h +35 -0
  164. package/ios/RNLuciq/RNLuciq.m +107 -0
  165. package/ios/RNLuciq/Util/LCQAPM+PrivateAPIs.h +15 -0
  166. package/ios/RNLuciq/Util/LCQCrashReporting+CP.h +13 -0
  167. package/ios/RNLuciq/Util/LCQNetworkLogger+CP.h +68 -0
  168. package/ios/RNLuciq/Util/Luciq+CP.h +12 -0
  169. package/ios/RNLuciq.xcodeproj/project.pbxproj +352 -0
  170. package/ios/native.rb +12 -0
  171. package/ios/sourcemaps.sh +120 -0
  172. package/migrate.js +569 -0
  173. package/package.json +92 -0
  174. package/plugin/build/index.js +42078 -0
  175. package/plugin/src/index.ts +5 -0
  176. package/plugin/src/pluginProps.ts +6 -0
  177. package/plugin/src/withLuciq.ts +51 -0
  178. package/plugin/src/withLuciqAndroid.ts +99 -0
  179. package/plugin/src/withLuciqIOS.ts +109 -0
  180. package/plugin/tsconfig.json +7 -0
  181. package/react-native.config.js +16 -0
  182. package/scripts/customize-ios-endpoints.sh +28 -0
  183. package/scripts/dream-11-delete-unused-features.sh +62 -0
  184. package/scripts/find-token.js +58 -0
  185. package/scripts/find-token.sh +70 -0
  186. package/scripts/notify-github.sh +15 -0
  187. package/scripts/replace.js +58 -0
  188. package/scripts/snapshot-comment.md +15 -0
  189. package/scripts/snapshot-version.sh +11 -0
  190. package/src/index.ts +40 -0
  191. package/src/models/FeatureFlag.ts +12 -0
  192. package/src/models/LuciqConfig.ts +48 -0
  193. package/src/models/NonFatalOptions.ts +16 -0
  194. package/src/models/OverAirUpdate.ts +14 -0
  195. package/src/models/Report.ts +124 -0
  196. package/src/models/ReproConfig.ts +31 -0
  197. package/src/models/SessionMetadata.ts +57 -0
  198. package/src/models/ThemeConfig.ts +34 -0
  199. package/src/models/W3cExternalTraceAttributes.ts +22 -0
  200. package/src/modules/APM.ts +117 -0
  201. package/src/modules/BugReporting.ts +254 -0
  202. package/src/modules/CrashReporting.ts +54 -0
  203. package/src/modules/FeatureRequests.ts +32 -0
  204. package/src/modules/Luciq.ts +934 -0
  205. package/src/modules/NetworkLogger.ts +270 -0
  206. package/src/modules/Replies.ts +137 -0
  207. package/src/modules/SessionReplay.ts +111 -0
  208. package/src/modules/Surveys.ts +118 -0
  209. package/src/native/NativeAPM.ts +51 -0
  210. package/src/native/NativeBugReporting.ts +70 -0
  211. package/src/native/NativeConstants.ts +215 -0
  212. package/src/native/NativeCrashReporting.ts +29 -0
  213. package/src/native/NativeFeatureRequests.ts +12 -0
  214. package/src/native/NativeLuciq.ts +179 -0
  215. package/src/native/NativeNetworkLogger.ts +42 -0
  216. package/src/native/NativePackage.ts +25 -0
  217. package/src/native/NativeReplies.ts +34 -0
  218. package/src/native/NativeSessionReplay.ts +21 -0
  219. package/src/native/NativeSurveys.ts +34 -0
  220. package/src/promise.d.ts +11 -0
  221. package/src/utils/AppStatesHandler.ts +19 -0
  222. package/src/utils/Enums.ts +266 -0
  223. package/src/utils/FeatureFlags.ts +33 -0
  224. package/src/utils/LuciqConstants.ts +24 -0
  225. package/src/utils/LuciqUtils.ts +417 -0
  226. package/src/utils/UnhandledRejectionTracking.ts +118 -0
  227. package/src/utils/XhrNetworkInterceptor.ts +333 -0
  228. package/src/utils/config.ts +7 -0
  229. package/src/utils/logger.ts +54 -0
  230. package/tsconfig.json +32 -0
  231. package/tsconfig.test.json +4 -0
  232. package/tsconfig.upload.json +10 -0
  233. package/upload/index.d.ts +4 -0
  234. package/upload/index.js +17314 -0
  235. package/upload/migrate.d.ts +14 -0
  236. package/upload/package.json +5 -0
  237. package/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
  238. package/upload/uploadSoFiles.d.ts +21 -0
  239. package/upload/uploadSourcemaps.d.ts +21 -0
@@ -0,0 +1,99 @@
1
+
2
+
3
+ #import "LuciqAPMBridge.h"
4
+ #import <LuciqSDK/LCQAPM.h>
5
+ #import <asl.h>
6
+ #import <React/RCTLog.h>
7
+ #import <os/log.h>
8
+ #import <LuciqSDK/LCQTypes.h>
9
+ #import <React/RCTUIManager.h>
10
+ #import "Util/LCQAPM+PrivateAPIs.h"
11
+
12
+ @implementation LuciqAPMBridge
13
+
14
+ - (dispatch_queue_t)methodQueue {
15
+ return dispatch_get_main_queue();
16
+ }
17
+
18
+ + (BOOL)requiresMainQueueSetup
19
+ {
20
+ return NO;
21
+ }
22
+
23
+ - (NSArray<NSString *> *)supportedEvents {
24
+ return @[];
25
+ }
26
+
27
+ RCT_EXPORT_MODULE(LCQAPM)
28
+
29
+ - (id) init
30
+ {
31
+ self = [super init];
32
+ return self;
33
+ }
34
+
35
+ // Pauses the current thread for 3 seconds.
36
+ RCT_EXPORT_METHOD(LCQSleep) {
37
+ [NSThread sleepForTimeInterval:3.0f];
38
+ }
39
+
40
+ // Enables or disables APM.
41
+ RCT_EXPORT_METHOD(setEnabled:(BOOL)isEnabled) {
42
+ LCQAPM.enabled = isEnabled;
43
+ }
44
+
45
+ // Determines either coldAppLaunch is enabled or not.
46
+ RCT_EXPORT_METHOD(setAppLaunchEnabled:(BOOL)isEnabled) {
47
+ LCQAPM.coldAppLaunchEnabled = isEnabled;
48
+ }
49
+
50
+ // This method is used to signal the end of the app launch process.
51
+ RCT_EXPORT_METHOD(endAppLaunch) {
52
+ [LCQAPM endAppLaunch];
53
+ }
54
+
55
+ // Controls whether automatic tracing of UI interactions is enabled or disabled within the SDK.
56
+ RCT_EXPORT_METHOD(setAutoUITraceEnabled:(BOOL)isEnabled) {
57
+ LCQAPM.autoUITraceEnabled = isEnabled;
58
+ }
59
+
60
+ // Starts a flow trace with the specified `name`,
61
+ // allowing the SDK to capture and analyze the flow of execution within the application.
62
+ RCT_EXPORT_METHOD(startFlow: (NSString *)name) {
63
+ [LCQAPM startFlowWithName:name];
64
+ }
65
+
66
+ // Ends a flow with the specified `name`.
67
+ RCT_EXPORT_METHOD(endFlow: (NSString *)name) {
68
+ [LCQAPM endFlowWithName:name];
69
+ }
70
+
71
+
72
+ // Sets a user defined attribute for the currently active flow.
73
+ RCT_EXPORT_METHOD(setFlowAttribute:(NSString *)name :(NSString *)key :(NSString *_Nullable)value) {
74
+ [LCQAPM setAttributeForFlowWithName:name key:key value:value];
75
+ }
76
+
77
+ // Starts a new `UITrace` with the provided `name` parameter,
78
+ // allowing the SDK to capture and analyze the UI components within the application.
79
+ RCT_EXPORT_METHOD(startUITrace:(NSString *)name) {
80
+ [LCQAPM startUITraceWithName:name];
81
+ }
82
+
83
+ // Terminates the currently active UI trace.
84
+ RCT_EXPORT_METHOD(endUITrace) {
85
+ [LCQAPM endUITrace];
86
+ }
87
+
88
+
89
+
90
+
91
+
92
+ @synthesize description;
93
+
94
+ @synthesize hash;
95
+
96
+ @synthesize superclass;
97
+
98
+ @end
99
+
@@ -0,0 +1,60 @@
1
+ //
2
+ // LuciqBugReportingBridge.h
3
+ // RNLuciq
4
+ //
5
+ // Created by Salma Ali on 7/30/19.
6
+ // Copyright © 2019 luciq. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+ #import <React/RCTBridgeModule.h>
11
+ #import <React/RCTEventEmitter.h>
12
+ #import <LuciqSDK/LCQTypes.h>
13
+ #import <LuciqSDK/LCQBugReporting.h>
14
+
15
+ @interface LuciqBugReportingBridge : RCTEventEmitter <RCTBridgeModule>
16
+ /*
17
+ +------------------------------------------------------------------------+
18
+ | BugReporting Module |
19
+ +------------------------------------------------------------------------+
20
+ */
21
+
22
+ - (void)setEnabled:(BOOL)isEnabled;
23
+
24
+ - (void)setInvocationEvents:(NSArray *)invocationEventsArray;
25
+
26
+ - (void)setOptions:(NSArray *)optionsArray;
27
+
28
+ - (void)setFloatingButtonEdge:(CGRectEdge)floatingButtonEdge withTopOffset:(double)floatingButtonOffsetFromTop;
29
+
30
+ - (void)setOnInvokeHandler:(RCTResponseSenderBlock)callBack;
31
+
32
+ - (void)setOnSDKDismissedHandler:(RCTResponseSenderBlock)callBack;
33
+
34
+ - (void)setShakingThresholdForiPhone:(double)iPhoneShakingThreshold;
35
+
36
+ - (void)setShakingThresholdForiPad:(double)iPadShakingThreshold;
37
+
38
+ - (void)setExtendedBugReportMode:(LCQExtendedBugReportMode)extendedBugReportMode;
39
+
40
+ - (void)setReportTypes:(NSArray *)types;
41
+
42
+ - (void)show:(LCQBugReportingReportType)type options:(NSArray *)options;
43
+
44
+ - (void)setAutoScreenRecordingEnabled:(BOOL)enabled;
45
+
46
+ - (void)setAutoScreenRecordingDuration:(CGFloat)duration;
47
+
48
+ - (void)setViewHierarchyEnabled:(BOOL)viewHirearchyEnabled;
49
+
50
+ - (void)setDisclaimerText:(NSString *)text;
51
+
52
+ - (void)setCommentMinimumCharacterCount:(NSNumber *)limit reportTypes:(NSArray *)reportTypes;
53
+
54
+ - (void)addUserConsent:(NSString *)key
55
+ description:(NSString *)description
56
+ mandatory:(BOOL)mandatory
57
+ checked:(BOOL)checked
58
+ actionType:(id)actionType;
59
+
60
+ @end
@@ -0,0 +1,241 @@
1
+ //
2
+ // LuciqBugReportingBridge.m
3
+ // RNLuciq
4
+ //
5
+ // Created by Salma Ali on 7/30/19.
6
+ // Copyright © 2019 luciq. All rights reserved.
7
+ //
8
+
9
+ #import "LuciqBugReportingBridge.h"
10
+ #import <LuciqSDK/LCQBugReporting.h>
11
+ #import <asl.h>
12
+ #import <React/RCTLog.h>
13
+ #import <os/log.h>
14
+ #import <React/RCTUIManager.h>
15
+
16
+ @implementation LuciqBugReportingBridge
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 @[
29
+ @"LCQpreInvocationHandler",
30
+ @"LCQpostInvocationHandler",
31
+ @"LCQDidSelectPromptOptionHandler",
32
+ ];
33
+ }
34
+
35
+ RCT_EXPORT_MODULE(LCQBugReporting)
36
+
37
+ RCT_EXPORT_METHOD(setEnabled:(BOOL) isEnabled) {
38
+ LCQBugReporting.enabled = isEnabled;
39
+ }
40
+
41
+ RCT_EXPORT_METHOD(setAutoScreenRecordingEnabled:(BOOL)enabled) {
42
+ LCQBugReporting.autoScreenRecordingEnabled = enabled;
43
+ }
44
+
45
+ RCT_EXPORT_METHOD(setAutoScreenRecordingDuration:(CGFloat)duration) {
46
+ LCQBugReporting.autoScreenRecordingDuration = duration;
47
+ }
48
+
49
+ RCT_EXPORT_METHOD(setOnInvokeHandler:(RCTResponseSenderBlock)callBack) {
50
+ if (callBack != nil) {
51
+ LCQBugReporting.willInvokeHandler = ^{
52
+ [self sendEventWithName:@"LCQpreInvocationHandler" body:nil];
53
+ };
54
+ } else {
55
+ LCQBugReporting.willInvokeHandler = nil;
56
+ }
57
+ }
58
+
59
+ RCT_EXPORT_METHOD(setOnSDKDismissedHandler:(RCTResponseSenderBlock)callBack) {
60
+ if (callBack != nil) {
61
+ LCQBugReporting.didDismissHandler = ^(LCQDismissType dismissType, LCQReportCategory reportType) {
62
+
63
+ //parse dismiss type enum
64
+ NSString* dismissTypeString;
65
+ if (dismissType == LCQDismissTypeCancel) {
66
+ dismissTypeString = @"CANCEL";
67
+ } else if (dismissType == LCQDismissTypeSubmit) {
68
+ dismissTypeString = @"SUBMIT";
69
+ } else if (dismissType == LCQDismissTypeAddAttachment) {
70
+ dismissTypeString = @"ADD_ATTACHMENT";
71
+ }
72
+
73
+ //parse report type enum
74
+ NSString* reportTypeString;
75
+ if (reportType == LCQReportCategoryBug) {
76
+ reportTypeString = @"bug";
77
+ } else if (reportType == LCQReportCategoryFeedback) {
78
+ reportTypeString = @"feedback";
79
+ } else {
80
+ reportTypeString = @"other";
81
+ }
82
+ NSDictionary *result = @{ @"dismissType": dismissTypeString,
83
+ @"reportType": reportTypeString};
84
+ [self sendEventWithName:@"LCQpostInvocationHandler" body: result];
85
+ };
86
+ } else {
87
+ LCQBugReporting.didDismissHandler = nil;
88
+ }
89
+ }
90
+
91
+ RCT_EXPORT_METHOD(setDidSelectPromptOptionHandler:(RCTResponseSenderBlock)callBack) {
92
+ if (callBack != nil) {
93
+
94
+ LCQBugReporting.didSelectPromptOptionHandler = ^(LCQPromptOption promptOption) {
95
+
96
+ NSString *promptOptionString;
97
+ if (promptOption == LCQPromptOptionBug) {
98
+ promptOptionString = @"bug";
99
+ } else if (promptOption == LCQBugReportingTypeFeedback) {
100
+ promptOptionString = @"feedback";
101
+ } else if (promptOption == LCQPromptOptionChat) {
102
+ promptOptionString = @"chat";
103
+ } else {
104
+ promptOptionString = @"none";
105
+ }
106
+
107
+ [self sendEventWithName:@"LCQDidSelectPromptOptionHandler" body:@{
108
+ @"promptOption": promptOptionString
109
+ }];
110
+ };
111
+ } else {
112
+ LCQBugReporting.didSelectPromptOptionHandler = nil;
113
+ }
114
+ }
115
+
116
+ RCT_EXPORT_METHOD(setInvocationEvents:(NSArray*)invocationEventsArray) {
117
+ LCQInvocationEvent invocationEvents = 0;
118
+ for (NSNumber *boxedValue in invocationEventsArray) {
119
+ invocationEvents |= [boxedValue intValue];
120
+ }
121
+ LCQBugReporting.invocationEvents = invocationEvents;
122
+ }
123
+
124
+ RCT_EXPORT_METHOD(setOptions:(NSArray*)invocationOptionsArray) {
125
+ LCQBugReportingOption invocationOptions = 0;
126
+
127
+ for (NSNumber *boxedValue in invocationOptionsArray) {
128
+ invocationOptions |= [boxedValue intValue];
129
+ }
130
+
131
+ LCQBugReporting.bugReportingOptions = invocationOptions;
132
+ }
133
+
134
+ RCT_EXPORT_METHOD(setFloatingButtonEdge:(CGRectEdge)floatingButtonEdge withTopOffset:(double)floatingButtonOffsetFromTop) {
135
+ LCQBugReporting.floatingButtonEdge = floatingButtonEdge;
136
+ LCQBugReporting.floatingButtonTopOffset = floatingButtonOffsetFromTop;
137
+ }
138
+
139
+ RCT_EXPORT_METHOD(setExtendedBugReportMode:(LCQExtendedBugReportMode)extendedBugReportMode) {
140
+ LCQBugReporting.extendedBugReportMode = extendedBugReportMode;
141
+ }
142
+
143
+ RCT_EXPORT_METHOD(setEnabledAttachmentTypes:(BOOL)screenShot
144
+ extraScreenShot:(BOOL)extraScreenShot
145
+ galleryImage:(BOOL)galleryImage
146
+ screenRecording:(BOOL)screenRecording) {
147
+ LCQAttachmentType attachmentTypes = 0;
148
+ if(screenShot) {
149
+ attachmentTypes = LCQAttachmentTypeScreenShot;
150
+ }
151
+ if(extraScreenShot) {
152
+ attachmentTypes |= LCQAttachmentTypeExtraScreenShot;
153
+ }
154
+ if(galleryImage) {
155
+ attachmentTypes |= LCQAttachmentTypeGalleryImage;
156
+ }
157
+ if(screenRecording) {
158
+ attachmentTypes |= LCQAttachmentTypeScreenRecording;
159
+ }
160
+
161
+ LCQBugReporting.enabledAttachmentTypes = attachmentTypes;
162
+ }
163
+
164
+ RCT_EXPORT_METHOD(setViewHierarchyEnabled:(BOOL)viewHirearchyEnabled) {
165
+ LCQBugReporting.shouldCaptureViewHierarchy = viewHirearchyEnabled;
166
+ }
167
+
168
+ RCT_EXPORT_METHOD(setVideoRecordingFloatingButtonPosition:(LCQPosition)position) {
169
+ LCQBugReporting.videoRecordingFloatingButtonPosition = position;
170
+ }
171
+
172
+ RCT_EXPORT_METHOD(setReportTypes:(NSArray*) types ) {
173
+ LCQBugReportingReportType reportTypes = 0;
174
+ for (NSNumber *boxedValue in types) {
175
+ reportTypes |= [boxedValue intValue];
176
+ }
177
+ [LCQBugReporting setPromptOptionsEnabledReportTypes: reportTypes];
178
+ }
179
+
180
+ RCT_EXPORT_METHOD(show:(LCQBugReportingReportType)type options:(NSArray*) options) {
181
+ LCQBugReportingOption parsedOptions = 0;
182
+ for (NSNumber *boxedValue in options) {
183
+ parsedOptions |= [boxedValue intValue];
184
+ }
185
+ NSArray* args = @[@(type), @(parsedOptions)];
186
+ [[NSRunLoop mainRunLoop] performSelector:@selector(showBugReportingWithReportTypeAndOptionsHelper:) target:self argument:args order:0 modes:@[NSDefaultRunLoopMode]];
187
+ }
188
+
189
+ - (void) showBugReportingWithReportTypeAndOptionsHelper:(NSArray*)args {
190
+ LCQBugReportingReportType parsedreportType = [args[0] intValue];
191
+ LCQBugReportingOption parsedOptions = [args[1] intValue];
192
+ [LCQBugReporting showWithReportType:parsedreportType options:parsedOptions];
193
+ }
194
+
195
+ RCT_EXPORT_METHOD(setShakingThresholdForiPhone:(double)iPhoneShakingThreshold) {
196
+ LCQBugReporting.shakingThresholdForiPhone = iPhoneShakingThreshold;
197
+ }
198
+
199
+ RCT_EXPORT_METHOD(setShakingThresholdForiPad:(double)iPadShakingThreshold) {
200
+ LCQBugReporting.shakingThresholdForiPad = iPadShakingThreshold;
201
+ }
202
+
203
+ RCT_EXPORT_METHOD(setDisclaimerText:(NSString*)text) {
204
+ [LCQBugReporting setDisclaimerText:text];
205
+ }
206
+
207
+ RCT_EXPORT_METHOD(setCommentMinimumCharacterCount:(nonnull NSNumber *)limit reportTypes:(NSArray *)reportTypes) {
208
+ LCQBugReportingType parsedReportTypes = 0;
209
+ if (![reportTypes count]) {
210
+ parsedReportTypes = @(LCQBugReportingTypeBug).integerValue | @(LCQBugReportingTypeFeedback).integerValue | @(LCQBugReportingTypeQuestion).integerValue;
211
+ }
212
+ else {
213
+ for (NSNumber *reportType in reportTypes) {
214
+ parsedReportTypes |= [reportType intValue];
215
+ }
216
+ }
217
+ [LCQBugReporting setCommentMinimumCharacterCount:[limit integerValue] forBugReportType:parsedReportTypes];
218
+ }
219
+
220
+ RCT_EXPORT_METHOD(addUserConsent:(NSString *)key
221
+ description:(NSString *)description
222
+ mandatory:(BOOL)mandatory
223
+ checked:(BOOL)checked
224
+ actionType:(id)actionType) {
225
+ LCQConsentAction mappedActionType = (LCQConsentAction)[actionType integerValue];
226
+
227
+ [LCQBugReporting addUserConsentWithKey:key
228
+ description:description
229
+ mandatory:mandatory
230
+ checked:checked
231
+ actionType:mappedActionType];
232
+ }
233
+
234
+
235
+ @synthesize description;
236
+
237
+ @synthesize hash;
238
+
239
+ @synthesize superclass;
240
+
241
+ @end
@@ -0,0 +1,18 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import <React/RCTBridgeModule.h>
3
+ #import <React/RCTEventEmitter.h>
4
+ #import <LuciqSDK/LCQBugReporting.h>
5
+ #import <LuciqSDK/LCQTypes.h>
6
+ #import <LuciqSDK/LCQCrashReporting.h>
7
+ #import <LuciqSDK/LuciqSDK.h>
8
+ #import "ArgsRegistry.h"
9
+
10
+ @interface LuciqCrashReportingBridge : RCTEventEmitter <RCTBridgeModule>
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;
17
+
18
+ @end
@@ -0,0 +1,68 @@
1
+ #import "LuciqCrashReportingBridge.h"
2
+ #import "Util/LCQCrashReporting+CP.h"
3
+
4
+
5
+ @implementation LuciqCrashReportingBridge
6
+
7
+ - (dispatch_queue_t)methodQueue {
8
+ return dispatch_get_main_queue();
9
+ }
10
+
11
+ + (BOOL)requiresMainQueueSetup
12
+ {
13
+ return NO;
14
+ }
15
+
16
+ - (NSArray<NSString *> *)supportedEvents {
17
+ return @[
18
+ @"LCQSendHandledJSCrash",
19
+ @"LCQSendUnhandledJSCrash",
20
+ ];
21
+ }
22
+
23
+ RCT_EXPORT_MODULE(LCQCrashReporting)
24
+
25
+ RCT_EXPORT_METHOD(setEnabled: (BOOL) isEnabled) {
26
+ LCQCrashReporting.enabled = isEnabled;
27
+ }
28
+
29
+ RCT_EXPORT_METHOD(sendJSCrash:(NSDictionary *)stackTrace
30
+ resolver:(RCTPromiseResolveBlock)resolve
31
+ rejecter:(RCTPromiseRejectBlock)reject) {
32
+
33
+ dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul);
34
+ dispatch_async(queue, ^{
35
+ [LCQCrashReporting cp_reportFatalCrashWithStackTrace:stackTrace];
36
+ resolve([NSNull null]);
37
+ });
38
+ }
39
+
40
+ RCT_EXPORT_METHOD(sendHandledJSCrash: (NSDictionary *)stackTrace
41
+ userAttributes:(nullable NSDictionary *)userAttributes fingerprint:(nullable NSString *)fingerprint nonFatalExceptionLevel:(LCQNonFatalLevel)nonFatalExceptionLevel
42
+ resolver:(RCTPromiseResolveBlock)resolve
43
+ rejecter:(RCTPromiseRejectBlock)reject) {
44
+
45
+ if([fingerprint isKindOfClass:NSNull.class]){
46
+ fingerprint = nil;
47
+ }
48
+
49
+ if([userAttributes isKindOfClass:NSNull.class]){
50
+ userAttributes = nil;
51
+ }
52
+ dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
53
+ dispatch_async(queue, ^{
54
+ [LCQCrashReporting cp_reportNonFatalCrashWithStackTrace:stackTrace level:nonFatalExceptionLevel groupingString:fingerprint userAttributes:userAttributes];
55
+
56
+ resolve([NSNull null]);
57
+ });
58
+
59
+ }
60
+ @synthesize description;
61
+
62
+ @synthesize hash;
63
+
64
+ @synthesize superclass;
65
+
66
+ @end
67
+
68
+
@@ -0,0 +1,30 @@
1
+ //
2
+ // LuciqFeatureRequestsBridge.h
3
+ // RNLuciq
4
+ //
5
+ // Created by Salma Ali on 7/30/19.
6
+ // Copyright © 2019 luciq. All rights reserved.
7
+ //
8
+
9
+ #import <Foundation/Foundation.h>
10
+ #import <React/RCTBridgeModule.h>
11
+ #import <React/RCTEventEmitter.h>
12
+ #import <LuciqSDK/LCQTypes.h>
13
+
14
+ @interface LuciqFeatureRequestsBridge : RCTEventEmitter <RCTBridgeModule>
15
+ /*
16
+ +------------------------------------------------------------------------+
17
+ | Feature Requests Module |
18
+ +------------------------------------------------------------------------+
19
+ */
20
+
21
+ - (void)setEmailFieldRequiredForFeatureRequests:(BOOL)isEmailFieldRequired forAction:(NSArray *)actionTypesArray;
22
+
23
+ - (void)show;
24
+
25
+ - (void)setEnabled:(BOOL) isEnabled;
26
+
27
+
28
+ @end
29
+
30
+
@@ -0,0 +1,61 @@
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
+ #import "LuciqFeatureRequestsBridge.h"
10
+ #import <LuciqSDK/LCQFeatureRequests.h>
11
+ #import <asl.h>
12
+ #import <React/RCTLog.h>
13
+ #import <os/log.h>
14
+ #import <LuciqSDK/LCQTypes.h>
15
+ #import <React/RCTUIManager.h>
16
+
17
+ @implementation LuciqFeatureRequestsBridge
18
+
19
+ - (dispatch_queue_t)methodQueue {
20
+ return dispatch_get_main_queue();
21
+ }
22
+
23
+ + (BOOL)requiresMainQueueSetup
24
+ {
25
+ return NO;
26
+ }
27
+
28
+ - (NSArray<NSString *> *)supportedEvents {
29
+ return @[];
30
+ }
31
+
32
+ RCT_EXPORT_MODULE(LCQFeatureRequests)
33
+
34
+ RCT_EXPORT_METHOD(show) {
35
+ [[NSRunLoop mainRunLoop] performSelector:@selector(show) target:[LCQFeatureRequests class] argument:nil order:0 modes:@[NSDefaultRunLoopMode]];
36
+ }
37
+
38
+ RCT_EXPORT_METHOD(setEmailFieldRequiredForFeatureRequests:(BOOL)isEmailFieldRequired
39
+ forAction:(NSArray *)actionTypesArray) {
40
+ LCQAction actionTypes = 0;
41
+
42
+ for (NSNumber *boxedValue in actionTypesArray) {
43
+ actionTypes |= [boxedValue intValue];
44
+ }
45
+
46
+ [LCQFeatureRequests setEmailFieldRequired:isEmailFieldRequired forAction:actionTypes];
47
+ }
48
+
49
+ RCT_EXPORT_METHOD(setEnabled: (BOOL) isEnabled) {
50
+ LCQFeatureRequests.enabled = isEnabled;
51
+ }
52
+
53
+ @synthesize description;
54
+
55
+ @synthesize hash;
56
+
57
+ @synthesize superclass;
58
+
59
+ @end
60
+
61
+
@@ -0,0 +1,44 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTEventEmitter.h>
3
+ #import <LuciqSDK/LCQTypes.h>
4
+
5
+ typedef void (^ LCQURLRequestAsyncObfuscationCompletedHandler)(NSURLRequest * _Nonnull request);
6
+ typedef void (^LCQURLRequestResponseAsyncFilteringCompletedHandler)(BOOL keep);
7
+
8
+ typedef NS_ENUM(NSInteger, NetworkListenerType) {
9
+ NetworkListenerTypeFiltering,
10
+ NetworkListenerTypeObfuscation,
11
+ NetworkListenerTypeBoth
12
+ };
13
+
14
+ @interface LuciqNetworkLoggerBridge : RCTEventEmitter <RCTBridgeModule>
15
+
16
+ @property NSMutableDictionary<NSString *, LCQURLRequestAsyncObfuscationCompletedHandler> * _Nonnull requestObfuscationCompletionDictionary;
17
+ @property NSMutableDictionary<NSString *, NetworkObfuscationCompletionBlock> * _Nonnull responseObfuscationCompletionDictionary;
18
+ @property NSMutableDictionary<NSString *, LCQURLRequestResponseAsyncFilteringCompletedHandler> * _Nonnull requestFilteringCompletionDictionary;
19
+ @property NSMutableDictionary<NSString *, LCQURLRequestResponseAsyncFilteringCompletedHandler> * _Nonnull responseFilteringCompletionDictionary;
20
+
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
+ @end