@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.
- package/CHANGELOG.md +5 -0
- package/FONTS_SETUP_GUIDE.md +521 -0
- package/Gemfile +1 -0
- package/Gemfile.lock +11 -0
- package/LICENSE +21 -0
- package/README.md +148 -0
- package/RNLuciq.podspec +21 -0
- package/android/build.gradle +88 -0
- package/android/gradle.properties +4 -0
- package/android/jacoco.gradle +52 -0
- package/android/native.gradle +7 -0
- package/android/proguard-rules.txt +1 -0
- package/android/sourcemaps.gradle +255 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/ai/luciq/reactlibrary/ArgsRegistry.java +278 -0
- package/android/src/main/java/ai/luciq/reactlibrary/Constants.java +20 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciq.java +328 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqAPMModule.java +392 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqBugReportingModule.java +444 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqCrashReportingModule.java +169 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqFeatureRequestsModule.java +98 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqNetworkLoggerModule.java +195 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativeModule.java +1611 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqReactnativePackage.java +41 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqRepliesModule.java +298 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSessionReplayModule.java +213 -0
- package/android/src/main/java/ai/luciq/reactlibrary/RNLuciqSurveysModule.java +237 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/ArrayUtil.java +167 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/EventEmitterModule.java +35 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/LuciqUtil.java +58 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/MainThreadHandler.java +13 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/MapUtil.java +171 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/RNTouchedViewExtractor.java +167 -0
- package/android/src/main/java/ai/luciq/reactlibrary/utils/ReportUtil.java +67 -0
- package/app.plugin.js +1 -0
- package/babel.config.js +3 -0
- package/bin/commands/MigrateCommand.d.ts +6 -0
- package/bin/commands/UploadEasUpdatesSourcemaps.d.ts +2 -0
- package/bin/commands/UploadSoFiles.d.ts +6 -0
- package/bin/commands/UploadSourcemaps.d.ts +2 -0
- package/bin/config/migration-config.json +125 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +19179 -0
- package/bin/upload/index.d.ts +4 -0
- package/bin/upload/migrate.d.ts +14 -0
- package/bin/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
- package/bin/upload/uploadSoFiles.d.ts +21 -0
- package/bin/upload/uploadSourcemaps.d.ts +21 -0
- package/cli/commands/MigrateCommand.ts +32 -0
- package/cli/commands/UploadEasUpdatesSourcemaps.ts +34 -0
- package/cli/commands/UploadSoFiles.ts +38 -0
- package/cli/commands/UploadSourcemaps.ts +40 -0
- package/cli/config/migration-config.json +125 -0
- package/cli/index.ts +21 -0
- package/cli/upload/index.ts +4 -0
- package/cli/upload/migrate.ts +271 -0
- package/cli/upload/uploadEasUpdatesSourcemaps.ts +74 -0
- package/cli/upload/uploadSoFiles.ts +112 -0
- package/cli/upload/uploadSourcemaps.ts +73 -0
- package/dangerfile.ts +44 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +14 -0
- package/dist/models/FeatureFlag.d.ts +11 -0
- package/dist/models/FeatureFlag.js +1 -0
- package/dist/models/LuciqConfig.d.ts +42 -0
- package/dist/models/LuciqConfig.js +1 -0
- package/dist/models/NonFatalOptions.d.ts +15 -0
- package/dist/models/NonFatalOptions.js +1 -0
- package/dist/models/OverAirUpdate.d.ts +12 -0
- package/dist/models/OverAirUpdate.js +1 -0
- package/dist/models/Report.d.ts +70 -0
- package/dist/models/Report.js +109 -0
- package/dist/models/ReproConfig.d.ts +27 -0
- package/dist/models/ReproConfig.js +1 -0
- package/dist/models/SessionMetadata.d.ts +55 -0
- package/dist/models/SessionMetadata.js +1 -0
- package/dist/models/ThemeConfig.d.ts +27 -0
- package/dist/models/ThemeConfig.js +1 -0
- package/dist/models/W3cExternalTraceAttributes.d.ts +22 -0
- package/dist/models/W3cExternalTraceAttributes.js +1 -0
- package/dist/modules/APM.d.ts +77 -0
- package/dist/modules/APM.js +104 -0
- package/dist/modules/BugReporting.d.ts +138 -0
- package/dist/modules/BugReporting.js +202 -0
- package/dist/modules/CrashReporting.d.ts +19 -0
- package/dist/modules/CrashReporting.js +40 -0
- package/dist/modules/FeatureRequests.d.ts +20 -0
- package/dist/modules/FeatureRequests.js +28 -0
- package/dist/modules/Luciq.d.ts +362 -0
- package/dist/modules/Luciq.js +797 -0
- package/dist/modules/NetworkLogger.d.ts +52 -0
- package/dist/modules/NetworkLogger.js +208 -0
- package/dist/modules/Replies.d.ts +78 -0
- package/dist/modules/Replies.js +121 -0
- package/dist/modules/SessionReplay.d.ts +78 -0
- package/dist/modules/SessionReplay.js +98 -0
- package/dist/modules/Surveys.d.ts +75 -0
- package/dist/modules/Surveys.js +101 -0
- package/dist/native/NativeAPM.d.ts +18 -0
- package/dist/native/NativeAPM.js +4 -0
- package/dist/native/NativeBugReporting.d.ts +32 -0
- package/dist/native/NativeBugReporting.js +10 -0
- package/dist/native/NativeConstants.d.ts +182 -0
- package/dist/native/NativeConstants.js +1 -0
- package/dist/native/NativeCrashReporting.d.ts +18 -0
- package/dist/native/NativeCrashReporting.js +2 -0
- package/dist/native/NativeFeatureRequests.d.ts +8 -0
- package/dist/native/NativeFeatureRequests.js +2 -0
- package/dist/native/NativeLuciq.d.ts +86 -0
- package/dist/native/NativeLuciq.js +10 -0
- package/dist/native/NativeNetworkLogger.d.ts +21 -0
- package/dist/native/NativeNetworkLogger.js +14 -0
- package/dist/native/NativePackage.d.ts +21 -0
- package/dist/native/NativePackage.js +2 -0
- package/dist/native/NativeReplies.d.ts +21 -0
- package/dist/native/NativeReplies.js +8 -0
- package/dist/native/NativeSessionReplay.d.ts +16 -0
- package/dist/native/NativeSessionReplay.js +8 -0
- package/dist/native/NativeSurveys.d.ts +22 -0
- package/dist/native/NativeSurveys.js +9 -0
- package/dist/utils/AppStatesHandler.d.ts +3 -0
- package/dist/utils/AppStatesHandler.js +16 -0
- package/dist/utils/Enums.d.ts +244 -0
- package/dist/utils/Enums.js +266 -0
- package/dist/utils/FeatureFlags.d.ts +7 -0
- package/dist/utils/FeatureFlags.js +24 -0
- package/dist/utils/LuciqConstants.d.ts +14 -0
- package/dist/utils/LuciqConstants.js +15 -0
- package/dist/utils/LuciqUtils.d.ts +97 -0
- package/dist/utils/LuciqUtils.js +301 -0
- package/dist/utils/UnhandledRejectionTracking.d.ts +9 -0
- package/dist/utils/UnhandledRejectionTracking.js +99 -0
- package/dist/utils/XhrNetworkInterceptor.d.ts +39 -0
- package/dist/utils/XhrNetworkInterceptor.js +253 -0
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.js +6 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.js +39 -0
- package/expo.d.ts +1 -0
- package/expo.js +1 -0
- package/ios/RNLuciq/ArgsRegistry.h +32 -0
- package/ios/RNLuciq/ArgsRegistry.m +276 -0
- package/ios/RNLuciq/LuciqAPMBridge.h +26 -0
- package/ios/RNLuciq/LuciqAPMBridge.m +99 -0
- package/ios/RNLuciq/LuciqBugReportingBridge.h +60 -0
- package/ios/RNLuciq/LuciqBugReportingBridge.m +241 -0
- package/ios/RNLuciq/LuciqCrashReportingBridge.h +18 -0
- package/ios/RNLuciq/LuciqCrashReportingBridge.m +68 -0
- package/ios/RNLuciq/LuciqFeatureRequestsBridge.h +30 -0
- package/ios/RNLuciq/LuciqFeatureRequestsBridge.m +61 -0
- package/ios/RNLuciq/LuciqNetworkLoggerBridge.h +44 -0
- package/ios/RNLuciq/LuciqNetworkLoggerBridge.m +206 -0
- package/ios/RNLuciq/LuciqReactBridge.h +151 -0
- package/ios/RNLuciq/LuciqReactBridge.m +548 -0
- package/ios/RNLuciq/LuciqRepliesBridge.h +40 -0
- package/ios/RNLuciq/LuciqRepliesBridge.m +80 -0
- package/ios/RNLuciq/LuciqSessionReplayBridge.h +32 -0
- package/ios/RNLuciq/LuciqSessionReplayBridge.m +107 -0
- package/ios/RNLuciq/LuciqSurveysBridge.h +46 -0
- package/ios/RNLuciq/LuciqSurveysBridge.m +107 -0
- package/ios/RNLuciq/RCTConvert+LuciqEnums.h +18 -0
- package/ios/RNLuciq/RCTConvert+LuciqEnums.m +127 -0
- package/ios/RNLuciq/RNLuciq.h +35 -0
- package/ios/RNLuciq/RNLuciq.m +107 -0
- package/ios/RNLuciq/Util/LCQAPM+PrivateAPIs.h +15 -0
- package/ios/RNLuciq/Util/LCQCrashReporting+CP.h +13 -0
- package/ios/RNLuciq/Util/LCQNetworkLogger+CP.h +68 -0
- package/ios/RNLuciq/Util/Luciq+CP.h +12 -0
- package/ios/RNLuciq.xcodeproj/project.pbxproj +352 -0
- package/ios/native.rb +12 -0
- package/ios/sourcemaps.sh +120 -0
- package/migrate.js +569 -0
- package/package.json +92 -0
- package/plugin/build/index.js +42078 -0
- package/plugin/src/index.ts +5 -0
- package/plugin/src/pluginProps.ts +6 -0
- package/plugin/src/withLuciq.ts +51 -0
- package/plugin/src/withLuciqAndroid.ts +99 -0
- package/plugin/src/withLuciqIOS.ts +109 -0
- package/plugin/tsconfig.json +7 -0
- package/react-native.config.js +16 -0
- package/scripts/customize-ios-endpoints.sh +28 -0
- package/scripts/dream-11-delete-unused-features.sh +62 -0
- package/scripts/find-token.js +58 -0
- package/scripts/find-token.sh +70 -0
- package/scripts/notify-github.sh +15 -0
- package/scripts/replace.js +58 -0
- package/scripts/snapshot-comment.md +15 -0
- package/scripts/snapshot-version.sh +11 -0
- package/src/index.ts +40 -0
- package/src/models/FeatureFlag.ts +12 -0
- package/src/models/LuciqConfig.ts +48 -0
- package/src/models/NonFatalOptions.ts +16 -0
- package/src/models/OverAirUpdate.ts +14 -0
- package/src/models/Report.ts +124 -0
- package/src/models/ReproConfig.ts +31 -0
- package/src/models/SessionMetadata.ts +57 -0
- package/src/models/ThemeConfig.ts +34 -0
- package/src/models/W3cExternalTraceAttributes.ts +22 -0
- package/src/modules/APM.ts +117 -0
- package/src/modules/BugReporting.ts +254 -0
- package/src/modules/CrashReporting.ts +54 -0
- package/src/modules/FeatureRequests.ts +32 -0
- package/src/modules/Luciq.ts +934 -0
- package/src/modules/NetworkLogger.ts +270 -0
- package/src/modules/Replies.ts +137 -0
- package/src/modules/SessionReplay.ts +111 -0
- package/src/modules/Surveys.ts +118 -0
- package/src/native/NativeAPM.ts +51 -0
- package/src/native/NativeBugReporting.ts +70 -0
- package/src/native/NativeConstants.ts +215 -0
- package/src/native/NativeCrashReporting.ts +29 -0
- package/src/native/NativeFeatureRequests.ts +12 -0
- package/src/native/NativeLuciq.ts +179 -0
- package/src/native/NativeNetworkLogger.ts +42 -0
- package/src/native/NativePackage.ts +25 -0
- package/src/native/NativeReplies.ts +34 -0
- package/src/native/NativeSessionReplay.ts +21 -0
- package/src/native/NativeSurveys.ts +34 -0
- package/src/promise.d.ts +11 -0
- package/src/utils/AppStatesHandler.ts +19 -0
- package/src/utils/Enums.ts +266 -0
- package/src/utils/FeatureFlags.ts +33 -0
- package/src/utils/LuciqConstants.ts +24 -0
- package/src/utils/LuciqUtils.ts +417 -0
- package/src/utils/UnhandledRejectionTracking.ts +118 -0
- package/src/utils/XhrNetworkInterceptor.ts +333 -0
- package/src/utils/config.ts +7 -0
- package/src/utils/logger.ts +54 -0
- package/tsconfig.json +32 -0
- package/tsconfig.test.json +4 -0
- package/tsconfig.upload.json +10 -0
- package/upload/index.d.ts +4 -0
- package/upload/index.js +17314 -0
- package/upload/migrate.d.ts +14 -0
- package/upload/package.json +5 -0
- package/upload/uploadEasUpdatesSourcemaps.d.ts +21 -0
- package/upload/uploadSoFiles.d.ts +21 -0
- package/upload/uploadSourcemaps.d.ts +21 -0
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LuciqReactBridge.m
|
|
3
|
+
// luciqDemo
|
|
4
|
+
//
|
|
5
|
+
// Created by Yousef Hamza on 9/29/16.
|
|
6
|
+
|
|
7
|
+
#import "LuciqReactBridge.h"
|
|
8
|
+
#import <LuciqSDK/LuciqSDK.h>
|
|
9
|
+
#import <LuciqSDK/LCQBugReporting.h>
|
|
10
|
+
#import <LuciqSDK/LCQCrashReporting.h>
|
|
11
|
+
#import <LuciqSDK/LCQLog.h>
|
|
12
|
+
#import <LuciqSDK/LCQAPM.h>
|
|
13
|
+
#import <asl.h>
|
|
14
|
+
#import <os/log.h>
|
|
15
|
+
#import <React/RCTUIManager.h>
|
|
16
|
+
#import "RNLuciq.h"
|
|
17
|
+
#import "Util/LCQNetworkLogger+CP.h"
|
|
18
|
+
|
|
19
|
+
@interface Luciq (PrivateWillSendAPI)
|
|
20
|
+
+ (void)setWillSendReportHandler_private:(void(^)(LCQReport *report, void(^reportCompletionHandler)(LCQReport *)))willSendReportHandler_private;
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
@implementation LuciqReactBridge
|
|
24
|
+
|
|
25
|
+
- (NSArray<NSString *> *)supportedEvents {
|
|
26
|
+
return @[@"LCQpreSendingHandler" , @"LCQNetworkLoggerHandler"];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
RCT_EXPORT_MODULE(Luciq)
|
|
30
|
+
|
|
31
|
+
- (dispatch_queue_t)methodQueue {
|
|
32
|
+
return dispatch_get_main_queue();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
RCT_EXPORT_METHOD(setEnabled:(BOOL)isEnabled) {
|
|
37
|
+
Luciq.enabled = isEnabled;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
RCT_EXPORT_METHOD(init:(NSString *)token
|
|
41
|
+
invocationEvents:(NSArray *)invocationEventsArray
|
|
42
|
+
debugLogsLevel:(LCQSDKDebugLogsLevel)sdkDebugLogsLevel
|
|
43
|
+
useNativeNetworkInterception:(BOOL)useNativeNetworkInterception
|
|
44
|
+
codePushVersion:(NSString *)codePushVersion
|
|
45
|
+
appVariant:(NSString *)appVariant
|
|
46
|
+
options:(nullable NSDictionary *)options
|
|
47
|
+
overAirVersion :(NSDictionary *)overAirVersion
|
|
48
|
+
) {
|
|
49
|
+
|
|
50
|
+
if(appVariant != nil){
|
|
51
|
+
Luciq.appVariant = appVariant;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
LCQInvocationEvent invocationEvents = 0;
|
|
55
|
+
|
|
56
|
+
for (NSNumber *boxedValue in invocationEventsArray) {
|
|
57
|
+
invocationEvents |= [boxedValue intValue];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[Luciq setCodePushVersion:codePushVersion];
|
|
61
|
+
|
|
62
|
+
[Luciq setOverAirVersion:overAirVersion[@"version"] withType:[overAirVersion[@"service"] intValue]];
|
|
63
|
+
|
|
64
|
+
[RNLuciq initWithToken:token
|
|
65
|
+
invocationEvents:invocationEvents
|
|
66
|
+
debugLogsLevel:sdkDebugLogsLevel
|
|
67
|
+
useNativeNetworkInterception:useNativeNetworkInterception];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
RCT_EXPORT_METHOD(setCodePushVersion:(NSString *)version) {
|
|
71
|
+
[Luciq setCodePushVersion:version];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
RCT_EXPORT_METHOD(setOverAirVersion:(NSDictionary *)overAirVersion) {
|
|
75
|
+
[Luciq setOverAirVersion:overAirVersion[@"version"] withType:[overAirVersion[@"service"] intValue]];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
RCT_EXPORT_METHOD(setAppVariant:(NSString *)appVariant) {
|
|
79
|
+
Luciq.appVariant = appVariant;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
RCT_EXPORT_METHOD(setReproStepsConfig:(LCQUserStepsMode)bugMode :(LCQUserStepsMode)crashMode:(LCQUserStepsMode)sessionReplayMode) {
|
|
83
|
+
[Luciq setReproStepsFor:LCQIssueTypeBug withMode:bugMode];
|
|
84
|
+
[Luciq setReproStepsFor:LCQIssueTypeAllCrashes withMode:crashMode];
|
|
85
|
+
[Luciq setReproStepsFor:LCQIssueTypeSessionReplay withMode:sessionReplayMode];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
RCT_EXPORT_METHOD(setFileAttachment:(NSString *)fileLocation) {
|
|
89
|
+
NSURL *url = [NSURL URLWithString:fileLocation];
|
|
90
|
+
[Luciq addFileAttachmentWithURL:url];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
RCT_EXPORT_METHOD(setUserData:(NSString *)userData) {
|
|
94
|
+
[Luciq setUserData:userData];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
RCT_EXPORT_METHOD(setTrackUserSteps:(BOOL)isEnabled) {
|
|
98
|
+
[Luciq setTrackUserSteps:isEnabled];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
LCQReport *currentReport = nil;
|
|
102
|
+
RCT_EXPORT_METHOD(setPreSendingHandler:(RCTResponseSenderBlock)callBack) {
|
|
103
|
+
if (callBack != nil) {
|
|
104
|
+
Luciq.willSendReportHandler = ^LCQReport * _Nonnull(LCQReport * _Nonnull report) {
|
|
105
|
+
NSArray *tagsArray = report.tags;
|
|
106
|
+
NSArray *luciqLogs= report.luciqLogs;
|
|
107
|
+
NSArray *consoleLogs= report.consoleLogs;
|
|
108
|
+
NSDictionary *userAttributes= report.userAttributes;
|
|
109
|
+
NSArray *fileAttachments= report.fileLocations;
|
|
110
|
+
NSDictionary *dict = @{ @"tagsArray" : tagsArray, @"luciqLogs" : luciqLogs, @"consoleLogs" : consoleLogs, @"userAttributes" : userAttributes, @"fileAttachments" : fileAttachments};
|
|
111
|
+
[self sendEventWithName:@"LCQpreSendingHandler" body:dict];
|
|
112
|
+
|
|
113
|
+
currentReport = report;
|
|
114
|
+
return report;
|
|
115
|
+
};
|
|
116
|
+
} else {
|
|
117
|
+
Luciq.willSendReportHandler = nil;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
RCT_EXPORT_METHOD(appendTagToReport:(NSString*) tag) {
|
|
122
|
+
if (currentReport != nil) {
|
|
123
|
+
[currentReport appendTag:tag];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
RCT_EXPORT_METHOD(appendConsoleLogToReport:(NSString*) consoleLog) {
|
|
128
|
+
if (currentReport != nil) {
|
|
129
|
+
[currentReport appendToConsoleLogs:consoleLog];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
RCT_EXPORT_METHOD(setUserAttributeToReport:(NSString*) key:(NSString*) value) {
|
|
134
|
+
if (currentReport != nil) {
|
|
135
|
+
[currentReport setUserAttribute:value withKey:key];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
RCT_EXPORT_METHOD(logDebugToReport:(NSString*) log) {
|
|
140
|
+
if (currentReport != nil) {
|
|
141
|
+
[currentReport logDebug:log];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
RCT_EXPORT_METHOD(logVerboseToReport:(NSString*) log) {
|
|
146
|
+
if (currentReport != nil) {
|
|
147
|
+
[currentReport logVerbose:log];
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
RCT_EXPORT_METHOD(logWarnToReport:(NSString*) log) {
|
|
152
|
+
if (currentReport != nil) {
|
|
153
|
+
[currentReport logWarn:log];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
RCT_EXPORT_METHOD(logErrorToReport:(NSString*) log) {
|
|
158
|
+
if (currentReport != nil) {
|
|
159
|
+
[currentReport logError:log];
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
RCT_EXPORT_METHOD(logInfoToReport:(NSString*) log) {
|
|
164
|
+
if (currentReport != nil) {
|
|
165
|
+
[currentReport logInfo:log];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
RCT_EXPORT_METHOD(addFileAttachmentWithURLToReport:(NSString*) urlString) {
|
|
170
|
+
if (currentReport != nil) {
|
|
171
|
+
NSURL *url = [NSURL URLWithString:urlString];
|
|
172
|
+
[currentReport addFileAttachmentWithURL:url];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
RCT_EXPORT_METHOD(addFileAttachmentWithDataToReport:(NSString*) dataString) {
|
|
177
|
+
if (currentReport != nil) {
|
|
178
|
+
NSData* data = [dataString dataUsingEncoding:NSUTF8StringEncoding];
|
|
179
|
+
[currentReport addFileAttachmentWithData:data];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
RCT_EXPORT_METHOD(setLocale:(LCQLocale)locale) {
|
|
184
|
+
[Luciq setLocale:locale];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
RCT_EXPORT_METHOD(setColorTheme:(LCQColorTheme)colorTheme) {
|
|
188
|
+
[Luciq setColorTheme:colorTheme];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
RCT_EXPORT_METHOD(setTheme:(NSDictionary *)themeConfig) {
|
|
193
|
+
LCQTheme *theme = [[LCQTheme alloc] init];
|
|
194
|
+
|
|
195
|
+
NSDictionary *colorMapping = @{
|
|
196
|
+
@"primaryColor": ^(UIColor *color) { theme.primaryColor = color; },
|
|
197
|
+
@"backgroundColor": ^(UIColor *color) { theme.backgroundColor = color; },
|
|
198
|
+
@"titleTextColor": ^(UIColor *color) { theme.titleTextColor = color; },
|
|
199
|
+
@"subtitleTextColor": ^(UIColor *color) { theme.subtitleTextColor = color; },
|
|
200
|
+
@"primaryTextColor": ^(UIColor *color) { theme.primaryTextColor = color; },
|
|
201
|
+
@"secondaryTextColor": ^(UIColor *color) { theme.secondaryTextColor = color; },
|
|
202
|
+
@"callToActionTextColor": ^(UIColor *color) { theme.callToActionTextColor = color; },
|
|
203
|
+
@"headerBackgroundColor": ^(UIColor *color) { theme.headerBackgroundColor = color; },
|
|
204
|
+
@"footerBackgroundColor": ^(UIColor *color) { theme.footerBackgroundColor = color; },
|
|
205
|
+
@"rowBackgroundColor": ^(UIColor *color) { theme.rowBackgroundColor = color; },
|
|
206
|
+
@"selectedRowBackgroundColor": ^(UIColor *color) { theme.selectedRowBackgroundColor = color; },
|
|
207
|
+
@"rowSeparatorColor": ^(UIColor *color) { theme.rowSeparatorColor = color; }
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
for (NSString *key in colorMapping) {
|
|
211
|
+
if (themeConfig[key]) {
|
|
212
|
+
NSString *colorString = themeConfig[key];
|
|
213
|
+
UIColor *color = [self colorFromHexString:colorString];
|
|
214
|
+
if (color) {
|
|
215
|
+
void (^setter)(UIColor *) = colorMapping[key];
|
|
216
|
+
setter(color);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
[self setFontIfPresent:themeConfig[@"primaryFontPath"] forTheme:theme type:@"primary"];
|
|
222
|
+
[self setFontIfPresent:themeConfig[@"secondaryFontPath"] forTheme:theme type:@"secondary"];
|
|
223
|
+
[self setFontIfPresent:themeConfig[@"ctaFontPath"] forTheme:theme type:@"cta"];
|
|
224
|
+
|
|
225
|
+
Luciq.theme = theme;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
- (void)setFontIfPresent:(NSString *)fontPath forTheme:(LCQTheme *)theme type:(NSString *)type {
|
|
229
|
+
if (fontPath) {
|
|
230
|
+
NSString *fileName = [fontPath lastPathComponent];
|
|
231
|
+
NSString *nameWithoutExtension = [fileName stringByDeletingPathExtension];
|
|
232
|
+
UIFont *font = [UIFont fontWithName:nameWithoutExtension size:17.0];
|
|
233
|
+
if (font) {
|
|
234
|
+
if ([type isEqualToString:@"primary"]) {
|
|
235
|
+
theme.primaryTextFont = font;
|
|
236
|
+
} else if ([type isEqualToString:@"secondary"]) {
|
|
237
|
+
theme.secondaryTextFont = font;
|
|
238
|
+
} else if ([type isEqualToString:@"cta"]) {
|
|
239
|
+
theme.callToActionTextFont = font;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
- (UIColor *)colorFromHexString:(NSString *)hexString {
|
|
246
|
+
NSString *cleanString = [hexString stringByReplacingOccurrencesOfString:@"#" withString:@""];
|
|
247
|
+
|
|
248
|
+
if (cleanString.length == 6) {
|
|
249
|
+
unsigned int rgbValue = 0;
|
|
250
|
+
NSScanner *scanner = [NSScanner scannerWithString:cleanString];
|
|
251
|
+
[scanner scanHexInt:&rgbValue];
|
|
252
|
+
|
|
253
|
+
return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16) / 255.0
|
|
254
|
+
green:((rgbValue & 0xFF00) >> 8) / 255.0
|
|
255
|
+
blue:(rgbValue & 0xFF) / 255.0
|
|
256
|
+
alpha:1.0];
|
|
257
|
+
} else if (cleanString.length == 8) {
|
|
258
|
+
unsigned int rgbaValue = 0;
|
|
259
|
+
NSScanner *scanner = [NSScanner scannerWithString:cleanString];
|
|
260
|
+
[scanner scanHexInt:&rgbaValue];
|
|
261
|
+
|
|
262
|
+
return [UIColor colorWithRed:((rgbaValue & 0xFF000000) >> 24) / 255.0
|
|
263
|
+
green:((rgbaValue & 0xFF0000) >> 16) / 255.0
|
|
264
|
+
blue:((rgbaValue & 0xFF00) >> 8) / 255.0
|
|
265
|
+
alpha:(rgbaValue & 0xFF) / 255.0];
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return [UIColor blackColor];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
RCT_EXPORT_METHOD(appendTags:(NSArray *)tags) {
|
|
274
|
+
[Luciq appendTags:tags];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
RCT_EXPORT_METHOD(resetTags) {
|
|
278
|
+
[Luciq resetTags];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
RCT_EXPORT_METHOD(getTags:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
282
|
+
resolve([Luciq getTags]);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
RCT_EXPORT_METHOD(setString:(NSString*)value toKey:(NSString*)key) {
|
|
286
|
+
[Luciq setValue:value forStringWithKey:key];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
RCT_EXPORT_METHOD(addFileAttachment:(NSString *)fileURLString) {
|
|
290
|
+
[Luciq addFileAttachmentWithURL:[NSURL URLWithString:fileURLString]];
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
RCT_EXPORT_METHOD(clearFileAttachments) {
|
|
294
|
+
[Luciq clearFileAttachments];
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
RCT_EXPORT_METHOD(identifyUser:(NSString *)email name:(NSString *)name userId:(nullable NSString *)userId) {
|
|
298
|
+
[Luciq identifyUserWithID:userId email:email name:name];
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
RCT_EXPORT_METHOD(logOut) {
|
|
302
|
+
[Luciq logOut];
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
RCT_EXPORT_METHOD(setUserAttribute:(NSString *)key withValue:(NSString *)value) {
|
|
306
|
+
[Luciq setUserAttribute:value withKey:key];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
RCT_EXPORT_METHOD(getUserAttribute:(NSString *)key :(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
310
|
+
@try {
|
|
311
|
+
resolve([Luciq userAttributeForKey:key]);
|
|
312
|
+
} @catch (NSException *exception) {
|
|
313
|
+
resolve(@"");
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
RCT_EXPORT_METHOD(removeUserAttribute:(NSString *)key) {
|
|
318
|
+
[Luciq removeUserAttributeForKey:key];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
RCT_EXPORT_METHOD(getAllUserAttributes:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
322
|
+
resolve([Luciq userAttributes]);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
RCT_EXPORT_METHOD(clearAllUserAttributes) {
|
|
326
|
+
for (NSString *key in [Luciq userAttributes].allKeys) {
|
|
327
|
+
[Luciq removeUserAttributeForKey:key];
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
RCT_EXPORT_METHOD(logUserEvent:(NSString *)name) {
|
|
332
|
+
[Luciq logUserEventWithName:name];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
RCT_EXPORT_METHOD(setLCQLogPrintsToConsole:(BOOL) printsToConsole) {
|
|
336
|
+
LCQLog.printsToConsole = printsToConsole;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
RCT_EXPORT_METHOD(logVerbose:(NSString *)log) {
|
|
340
|
+
[LCQLog logVerbose:log];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
RCT_EXPORT_METHOD(logDebug:(NSString *)log) {
|
|
344
|
+
[LCQLog logDebug:log];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
RCT_EXPORT_METHOD(logInfo:(NSString *)log) {
|
|
348
|
+
[LCQLog logInfo:log];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
RCT_EXPORT_METHOD(logWarn:(NSString *)log) {
|
|
352
|
+
[LCQLog logWarn:log];
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
RCT_EXPORT_METHOD(logError:(NSString *)log) {
|
|
356
|
+
[LCQLog logError:log];
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
RCT_EXPORT_METHOD(clearLogs) {
|
|
360
|
+
[LCQLog clearAllLogs];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
RCT_EXPORT_METHOD(setSessionProfilerEnabled:(BOOL)sessionProfilerEnabled) {
|
|
364
|
+
[Luciq setSessionProfilerEnabled:sessionProfilerEnabled];
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
RCT_EXPORT_METHOD(showWelcomeMessageWithMode:(LCQWelcomeMessageMode)welcomeMessageMode) {
|
|
368
|
+
[Luciq showWelcomeMessageWithMode:welcomeMessageMode];
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
RCT_EXPORT_METHOD(setWelcomeMessageMode:(LCQWelcomeMessageMode)welcomeMessageMode) {
|
|
372
|
+
[Luciq setWelcomeMessageMode:welcomeMessageMode];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
RCT_EXPORT_METHOD(setNetworkLoggingEnabled:(BOOL)isEnabled) {
|
|
376
|
+
if(isEnabled) {
|
|
377
|
+
LCQNetworkLogger.enabled = YES;
|
|
378
|
+
} else {
|
|
379
|
+
LCQNetworkLogger.enabled = NO;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
RCT_EXPORT_METHOD(networkLogIOS:(NSString * _Nonnull)url
|
|
384
|
+
method:(NSString * _Nonnull)method
|
|
385
|
+
requestBody:(NSString * _Nonnull)requestBody
|
|
386
|
+
requestBodySize:(double)requestBodySize
|
|
387
|
+
responseBody:(NSString * _Nonnull)responseBody
|
|
388
|
+
responseBodySize:(double)responseBodySize
|
|
389
|
+
responseCode:(double)responseCode
|
|
390
|
+
requestHeaders:(NSDictionary * _Nonnull)requestHeaders
|
|
391
|
+
responseHeaders:(NSDictionary * _Nonnull)responseHeaders
|
|
392
|
+
contentType:(NSString * _Nonnull)contentType
|
|
393
|
+
errorDomain:(NSString * _Nullable)errorDomain
|
|
394
|
+
errorCode:(double)errorCode
|
|
395
|
+
startTime:(double)startTime
|
|
396
|
+
duration:(double)duration
|
|
397
|
+
gqlQueryName:(NSString * _Nullable)gqlQueryName
|
|
398
|
+
serverErrorMessage:(NSString * _Nullable)serverErrorMessage
|
|
399
|
+
w3cExternalTraceAttributes:(NSDictionary * _Nullable)w3cExternalTraceAttributes){
|
|
400
|
+
NSNumber *isW3cCaught = (w3cExternalTraceAttributes[@"isW3cHeaderFound"] != [NSNull null]) ? w3cExternalTraceAttributes[@"isW3cHeaderFound"] : nil;
|
|
401
|
+
NSNumber * partialID = (w3cExternalTraceAttributes[@"partialId"] != [NSNull null]) ? w3cExternalTraceAttributes[@"partialId"] : nil;
|
|
402
|
+
NSNumber * timestamp = (w3cExternalTraceAttributes[@"networkStartTimeInSeconds"] != [NSNull null]) ? w3cExternalTraceAttributes[@"networkStartTimeInSeconds"] : nil;
|
|
403
|
+
NSString * generatedW3CTraceparent = (w3cExternalTraceAttributes[@"w3cGeneratedHeader"] != [NSNull null]) ? w3cExternalTraceAttributes[@"w3cGeneratedHeader"] : nil;
|
|
404
|
+
NSString * caughtW3CTraceparent = (w3cExternalTraceAttributes[@"w3cCaughtHeader"] != [NSNull null]) ? w3cExternalTraceAttributes[@"w3cCaughtHeader"] : nil;
|
|
405
|
+
|
|
406
|
+
[LCQNetworkLogger addNetworkLogWithUrl:url
|
|
407
|
+
method:method
|
|
408
|
+
requestBody:requestBody
|
|
409
|
+
requestBodySize:requestBodySize
|
|
410
|
+
responseBody:responseBody
|
|
411
|
+
responseBodySize:responseBodySize
|
|
412
|
+
responseCode:responseCode
|
|
413
|
+
requestHeaders:requestHeaders
|
|
414
|
+
responseHeaders:responseHeaders
|
|
415
|
+
contentType:contentType
|
|
416
|
+
errorDomain:errorDomain
|
|
417
|
+
errorCode:errorCode
|
|
418
|
+
startTime:startTime * 1000
|
|
419
|
+
duration:duration * 1000
|
|
420
|
+
gqlQueryName:gqlQueryName
|
|
421
|
+
serverErrorMessage:serverErrorMessage
|
|
422
|
+
isW3cCaughted:isW3cCaught
|
|
423
|
+
partialID:partialID
|
|
424
|
+
timestamp:timestamp
|
|
425
|
+
generatedW3CTraceparent:generatedW3CTraceparent
|
|
426
|
+
caughtedW3CTraceparent:caughtW3CTraceparent
|
|
427
|
+
];
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
RCT_EXPORT_METHOD(addPrivateView: (nonnull NSNumber *)reactTag) {
|
|
431
|
+
UIView* view = [self.bridge.uiManager viewForReactTag:reactTag];
|
|
432
|
+
view.Luciq_privateView = true;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
RCT_EXPORT_METHOD(removePrivateView: (nonnull NSNumber *)reactTag) {
|
|
436
|
+
UIView* view = [self.bridge.uiManager viewForReactTag:reactTag];
|
|
437
|
+
view.Luciq_privateView = false;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
RCT_EXPORT_METHOD(show) {
|
|
441
|
+
[[NSRunLoop mainRunLoop] performSelector:@selector(show) target:[Luciq class] argument:nil order:0 modes:@[NSDefaultRunLoopMode]];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
RCT_EXPORT_METHOD(reportScreenChange:(NSString *)screenName) {
|
|
445
|
+
SEL setPrivateApiSEL = NSSelectorFromString(@"logViewDidAppearEvent:");
|
|
446
|
+
if ([[Luciq class] respondsToSelector:setPrivateApiSEL]) {
|
|
447
|
+
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[[Luciq class] methodSignatureForSelector:setPrivateApiSEL]];
|
|
448
|
+
[inv setSelector:setPrivateApiSEL];
|
|
449
|
+
[inv setTarget:[Luciq class]];
|
|
450
|
+
[inv setArgument:&(screenName) atIndex:2];
|
|
451
|
+
[inv invoke];
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
RCT_EXPORT_METHOD(addFeatureFlags:(NSDictionary *)featureFlagsMap) {
|
|
456
|
+
NSMutableArray<LCQFeatureFlag *> *featureFlags = [NSMutableArray array];
|
|
457
|
+
for(id key in featureFlagsMap){
|
|
458
|
+
NSString* variant =[featureFlagsMap objectForKey:key];
|
|
459
|
+
if ([variant length]==0) {
|
|
460
|
+
[featureFlags addObject:[[LCQFeatureFlag alloc] initWithName:key]];
|
|
461
|
+
} else{
|
|
462
|
+
[featureFlags addObject:[[LCQFeatureFlag alloc] initWithName:key variant:variant]];
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
[Luciq addFeatureFlags:featureFlags];
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
RCT_EXPORT_METHOD(removeFeatureFlags:(NSArray *)featureFlags) {
|
|
470
|
+
NSMutableArray<LCQFeatureFlag *> *features = [NSMutableArray array];
|
|
471
|
+
for(id item in featureFlags){
|
|
472
|
+
[features addObject:[[LCQFeatureFlag alloc] initWithName:item]];
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
@try {
|
|
476
|
+
[Luciq removeFeatureFlags:features];
|
|
477
|
+
}
|
|
478
|
+
@catch (NSException *exception) {
|
|
479
|
+
NSLog(@"%@", exception);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
RCT_EXPORT_METHOD(removeAllFeatureFlags) {
|
|
484
|
+
[Luciq removeAllFeatureFlags];
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
RCT_EXPORT_METHOD(willRedirectToStore){
|
|
488
|
+
[Luciq willRedirectToAppStore];
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
RCT_EXPORT_METHOD(isW3ExternalTraceIDEnabled:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
492
|
+
resolve(@(LCQNetworkLogger.w3ExternalTraceIDEnabled));
|
|
493
|
+
}
|
|
494
|
+
RCT_EXPORT_METHOD(isW3ExternalGeneratedHeaderEnabled:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
495
|
+
resolve(@(LCQNetworkLogger.w3ExternalGeneratedHeaderEnabled));
|
|
496
|
+
}
|
|
497
|
+
RCT_EXPORT_METHOD(isW3CaughtHeaderEnabled:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
498
|
+
resolve(@(LCQNetworkLogger.w3CaughtHeaderEnabled));
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
- (NSDictionary *)constantsToExport {
|
|
503
|
+
return ArgsRegistry.getAll;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
- (void) setBaseUrlForDeprecationLogs {
|
|
507
|
+
SEL setCurrentPlatformSEL = NSSelectorFromString(@"setCurrentPlatform:");
|
|
508
|
+
if([[Luciq class] respondsToSelector:setCurrentPlatformSEL]) {
|
|
509
|
+
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[[Luciq class] methodSignatureForSelector:setCurrentPlatformSEL]];
|
|
510
|
+
[inv setSelector:setCurrentPlatformSEL];
|
|
511
|
+
[inv setTarget:[Luciq class]];
|
|
512
|
+
LCQPlatform platform = LCQPlatformReactNative;
|
|
513
|
+
[inv setArgument:&(platform) atIndex:2];
|
|
514
|
+
|
|
515
|
+
[inv invoke];
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
+ (BOOL)requiresMainQueueSetup
|
|
520
|
+
{
|
|
521
|
+
return NO;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
+ (BOOL)iOSVersionIsLessThan:(NSString *)iOSVersion {
|
|
525
|
+
return [iOSVersion compare:[UIDevice currentDevice].systemVersion options:NSNumericSearch] == NSOrderedDescending;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
RCT_EXPORT_METHOD(enableAutoMasking:(NSArray *)autoMaskingTypes) {
|
|
529
|
+
|
|
530
|
+
LCQAutoMaskScreenshotOption autoMaskingOptions = 0;
|
|
531
|
+
|
|
532
|
+
for (NSNumber *event in autoMaskingTypes) {
|
|
533
|
+
|
|
534
|
+
autoMaskingOptions |= [event intValue];
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
[Luciq setAutoMaskScreenshots: autoMaskingOptions];
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
RCT_EXPORT_METHOD(getNetworkBodyMaxSize:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
541
|
+
resolve(@(LCQNetworkLogger.getNetworkBodyMaxSize));
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
RCT_EXPORT_METHOD(setNetworkLogBodyEnabled:(BOOL)isEnabled) {
|
|
545
|
+
LCQNetworkLogger.logBodyEnabled = isEnabled;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
@end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LuciqRepliesBridge.h
|
|
3
|
+
// RNLuciq
|
|
4
|
+
//
|
|
5
|
+
// Created by Salma Ali on 7/30/19.
|
|
6
|
+
// Copyright © 2019 luciq. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import <React/RCTBridgeModule.h>
|
|
12
|
+
#import <React/RCTEventEmitter.h>
|
|
13
|
+
#import <LuciqSDK/LCQTypes.h>
|
|
14
|
+
|
|
15
|
+
@interface LuciqRepliesBridge : RCTEventEmitter <RCTBridgeModule>
|
|
16
|
+
/*
|
|
17
|
+
+------------------------------------------------------------------------+
|
|
18
|
+
| Replies Module |
|
|
19
|
+
+------------------------------------------------------------------------+
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
- (void)setEnabled:(BOOL) isEnabled;
|
|
23
|
+
|
|
24
|
+
- (void)hasChats:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject;
|
|
25
|
+
|
|
26
|
+
- (void)show;
|
|
27
|
+
|
|
28
|
+
- (void)setOnNewReplyReceivedHandler:(RCTResponseSenderBlock) callback;
|
|
29
|
+
|
|
30
|
+
- (void)getUnreadRepliesCount:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject;
|
|
31
|
+
|
|
32
|
+
- (void)setInAppNotificationEnabled:(BOOL)isChatNotificationEnabled;
|
|
33
|
+
|
|
34
|
+
- (void)setPushNotificationsEnabled:(BOOL)isPushNotificationEnabled;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LuciqRepliesBridge.m
|
|
3
|
+
// RNLuciq
|
|
4
|
+
//
|
|
5
|
+
// Created by Salma Ali on 7/30/19.
|
|
6
|
+
// Copyright © 2019 luciq. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
#import "LuciqRepliesBridge.h"
|
|
11
|
+
#import <LuciqSDK/LCQReplies.h>
|
|
12
|
+
#import <asl.h>
|
|
13
|
+
#import <React/RCTLog.h>
|
|
14
|
+
#import <os/log.h>
|
|
15
|
+
#import <LuciqSDK/LCQTypes.h>
|
|
16
|
+
#import <React/RCTUIManager.h>
|
|
17
|
+
|
|
18
|
+
@implementation LuciqRepliesBridge
|
|
19
|
+
|
|
20
|
+
- (dispatch_queue_t)methodQueue {
|
|
21
|
+
return dispatch_get_main_queue();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
+ (BOOL)requiresMainQueueSetup
|
|
25
|
+
{
|
|
26
|
+
return NO;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
- (NSArray<NSString *> *)supportedEvents {
|
|
30
|
+
return @[@"LCQOnNewReplyReceivedCallback"];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
RCT_EXPORT_MODULE(LCQReplies)
|
|
34
|
+
|
|
35
|
+
RCT_EXPORT_METHOD(setEnabled:(BOOL) isEnabled) {
|
|
36
|
+
LCQReplies.enabled = isEnabled;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
RCT_EXPORT_METHOD(hasChats:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
40
|
+
BOOL hasChats = LCQReplies.hasChats;
|
|
41
|
+
resolve(@(hasChats));
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
RCT_EXPORT_METHOD(show) {
|
|
46
|
+
[[NSRunLoop mainRunLoop] performSelector:@selector(show) target:[LCQReplies class] argument:nil order:0 modes:@[NSDefaultRunLoopMode]];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
RCT_EXPORT_METHOD(setOnNewReplyReceivedHandler:(RCTResponseSenderBlock) callback) {
|
|
50
|
+
if (callback != nil) {
|
|
51
|
+
LCQReplies.didReceiveReplyHandler = ^{
|
|
52
|
+
[self sendEventWithName:@"LCQOnNewReplyReceivedCallback" body:nil];
|
|
53
|
+
};
|
|
54
|
+
} else {
|
|
55
|
+
LCQReplies.didReceiveReplyHandler = nil;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
RCT_EXPORT_METHOD(getUnreadRepliesCount:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject) {
|
|
61
|
+
resolve(@(LCQReplies.unreadRepliesCount));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
RCT_EXPORT_METHOD(setInAppNotificationEnabled:(BOOL)isChatNotificationEnabled) {
|
|
65
|
+
LCQReplies.inAppNotificationsEnabled = isChatNotificationEnabled;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
RCT_EXPORT_METHOD(setPushNotificationsEnabled:(BOOL)isPushNotificationEnabled) {
|
|
69
|
+
[LCQReplies setPushNotificationsEnabled:isPushNotificationEnabled];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@synthesize description;
|
|
73
|
+
|
|
74
|
+
@synthesize hash;
|
|
75
|
+
|
|
76
|
+
@synthesize superclass;
|
|
77
|
+
|
|
78
|
+
@end
|
|
79
|
+
|
|
80
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <React/RCTBridgeModule.h>
|
|
3
|
+
#import <React/RCTEventEmitter.h>
|
|
4
|
+
#import <LuciqSDK/LCQTypes.h>
|
|
5
|
+
#import <LuciqSDK/LCQSessionReplay.h>
|
|
6
|
+
|
|
7
|
+
@interface LuciqSessionReplayBridge : RCTEventEmitter <RCTBridgeModule>
|
|
8
|
+
/*
|
|
9
|
+
+------------------------------------------------------------------------+
|
|
10
|
+
| Session Replay Module |
|
|
11
|
+
+------------------------------------------------------------------------+
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
- (void)setEnabled:(BOOL)isEnabled;
|
|
15
|
+
|
|
16
|
+
- (void)setLuciqLogsEnabled:(BOOL)isEnabled;
|
|
17
|
+
|
|
18
|
+
- (void)setNetworkLogsEnabled:(BOOL)isEnabled;
|
|
19
|
+
|
|
20
|
+
- (void)setUserStepsEnabled:(BOOL)isEnabled;
|
|
21
|
+
|
|
22
|
+
- (void)getSessionReplayLink:(RCTPromiseResolveBlock)resolve :(RCTPromiseRejectBlock)reject;
|
|
23
|
+
|
|
24
|
+
- (void)setSyncCallback;
|
|
25
|
+
|
|
26
|
+
- (void)evaluateSync:(BOOL)result;
|
|
27
|
+
|
|
28
|
+
@property (atomic, copy) SessionEvaluationCompletion sessionEvaluationCompletion;
|
|
29
|
+
|
|
30
|
+
@end
|
|
31
|
+
|
|
32
|
+
|