@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,278 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
|
|
5
|
+
import ai.luciq.bug.BugReporting;
|
|
6
|
+
import ai.luciq.bug.invocation.Option;
|
|
7
|
+
import ai.luciq.crash.models.LuciqNonFatalException;
|
|
8
|
+
import ai.luciq.featuresrequest.ActionType;
|
|
9
|
+
import ai.luciq.library.LuciqColorTheme;
|
|
10
|
+
import ai.luciq.library.LuciqCustomTextPlaceHolder.Key;
|
|
11
|
+
import ai.luciq.library.OnSdkDismissCallback.DismissType;
|
|
12
|
+
import ai.luciq.library.ReproMode;
|
|
13
|
+
import ai.luciq.library.extendedbugreport.ExtendedBugReport;
|
|
14
|
+
import ai.luciq.library.internal.module.LuciqLocale;
|
|
15
|
+
import ai.luciq.library.invocation.LuciqInvocationEvent;
|
|
16
|
+
import ai.luciq.library.invocation.util.LuciqFloatingButtonEdge;
|
|
17
|
+
import ai.luciq.library.invocation.util.LuciqVideoRecordingButtonPosition;
|
|
18
|
+
import ai.luciq.library.sessionreplay.model.SessionMetadata;
|
|
19
|
+
import ai.luciq.library.ui.onboarding.WelcomeMessage;
|
|
20
|
+
import ai.luciq.library.util.overairversion.OverAirVersionType;
|
|
21
|
+
import ai.luciq.library.MaskingType;
|
|
22
|
+
|
|
23
|
+
import java.util.ArrayList;
|
|
24
|
+
import java.util.HashMap;
|
|
25
|
+
import java.util.Map;
|
|
26
|
+
|
|
27
|
+
final class ArgsRegistry {
|
|
28
|
+
|
|
29
|
+
static class ArgsMap<T> extends HashMap<String, T> {
|
|
30
|
+
@NonNull
|
|
31
|
+
@Override
|
|
32
|
+
public T getOrDefault(Object key, T defaultValue) {
|
|
33
|
+
final T value = get(key);
|
|
34
|
+
return value != null ? value : defaultValue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public ArrayList<T> getAll(ArrayList<String> keys) {
|
|
38
|
+
final ArrayList<T> values = new ArrayList<>();
|
|
39
|
+
for (String key : keys) {
|
|
40
|
+
values.add(get(key));
|
|
41
|
+
}
|
|
42
|
+
return values;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@SuppressWarnings("deprecation")
|
|
47
|
+
static Map<String, Object> getAll() {
|
|
48
|
+
return new HashMap<String, Object>() {{
|
|
49
|
+
putAll(invocationEvents);
|
|
50
|
+
putAll(invocationOptions);
|
|
51
|
+
putAll(colorThemes);
|
|
52
|
+
putAll(floatingButtonEdges);
|
|
53
|
+
putAll(recordButtonPositions);
|
|
54
|
+
putAll(welcomeMessageStates);
|
|
55
|
+
putAll(reportTypes);
|
|
56
|
+
putAll(dismissTypes);
|
|
57
|
+
putAll(actionTypes);
|
|
58
|
+
putAll(extendedBugReportStates);
|
|
59
|
+
putAll(reproModes);
|
|
60
|
+
putAll(sdkLogLevels);
|
|
61
|
+
putAll(nonFatalExceptionLevel);
|
|
62
|
+
putAll(locales);
|
|
63
|
+
putAll(placeholders);
|
|
64
|
+
putAll(launchType);
|
|
65
|
+
putAll(overAirUpdateService);
|
|
66
|
+
putAll(autoMaskingTypes);
|
|
67
|
+
putAll(userConsentActionType);
|
|
68
|
+
}};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public static ArgsMap<LuciqNonFatalException.Level> nonFatalExceptionLevel = new ArgsMap<LuciqNonFatalException.Level>() {{
|
|
72
|
+
put("nonFatalErrorLevelCritical", LuciqNonFatalException.Level.CRITICAL);
|
|
73
|
+
put("nonFatalErrorLevelError", LuciqNonFatalException.Level.ERROR);
|
|
74
|
+
put("nonFatalErrorLevelWarning", LuciqNonFatalException.Level.WARNING);
|
|
75
|
+
put("nonFatalErrorLevelInfo", LuciqNonFatalException.Level.INFO);
|
|
76
|
+
}};
|
|
77
|
+
|
|
78
|
+
static ArgsMap<LuciqInvocationEvent> invocationEvents = new ArgsMap<LuciqInvocationEvent>() {{
|
|
79
|
+
put("invocationEventNone", LuciqInvocationEvent.NONE);
|
|
80
|
+
put("invocationEventShake", LuciqInvocationEvent.SHAKE);
|
|
81
|
+
put("invocationEventFloatingButton", LuciqInvocationEvent.FLOATING_BUTTON);
|
|
82
|
+
put("invocationEventScreenshot", LuciqInvocationEvent.SCREENSHOT);
|
|
83
|
+
put("invocationEventTwoFingersSwipeLeft", LuciqInvocationEvent.TWO_FINGER_SWIPE_LEFT);
|
|
84
|
+
}};
|
|
85
|
+
|
|
86
|
+
static final ArgsMap<Integer> invocationOptions = new ArgsMap<Integer>() {{
|
|
87
|
+
put("optionEmailFieldHidden", Option.EMAIL_FIELD_HIDDEN);
|
|
88
|
+
put("optionEmailFieldOptional", Option.EMAIL_FIELD_OPTIONAL);
|
|
89
|
+
put("optionCommentFieldRequired", Option.COMMENT_FIELD_REQUIRED);
|
|
90
|
+
put("optionDisablePostSendingDialog", Option.DISABLE_POST_SENDING_DIALOG);
|
|
91
|
+
}};
|
|
92
|
+
|
|
93
|
+
static final ArgsMap<LuciqColorTheme> colorThemes = new ArgsMap<LuciqColorTheme>() {{
|
|
94
|
+
put("colorThemeLight", LuciqColorTheme.LuciqColorThemeLight);
|
|
95
|
+
put("colorThemeDark", LuciqColorTheme.LuciqColorThemeDark);
|
|
96
|
+
}};
|
|
97
|
+
|
|
98
|
+
static final ArgsMap<LuciqFloatingButtonEdge> floatingButtonEdges = new ArgsMap<LuciqFloatingButtonEdge>() {{
|
|
99
|
+
put("left", LuciqFloatingButtonEdge.LEFT);
|
|
100
|
+
put("right", LuciqFloatingButtonEdge.RIGHT);
|
|
101
|
+
put("floatingButtonEdgeLeft", LuciqFloatingButtonEdge.LEFT);
|
|
102
|
+
put("floatingButtonEdgeRight", LuciqFloatingButtonEdge.RIGHT);
|
|
103
|
+
put("rectMinXEdge", LuciqFloatingButtonEdge.LEFT);
|
|
104
|
+
put("rectMaxXEdge", LuciqFloatingButtonEdge.RIGHT);
|
|
105
|
+
}};
|
|
106
|
+
|
|
107
|
+
static ArgsMap<LuciqVideoRecordingButtonPosition> recordButtonPositions = new ArgsMap<LuciqVideoRecordingButtonPosition>() {{
|
|
108
|
+
put("topLeft", LuciqVideoRecordingButtonPosition.TOP_LEFT);
|
|
109
|
+
put("topRight", LuciqVideoRecordingButtonPosition.TOP_RIGHT);
|
|
110
|
+
put("bottomLeft", LuciqVideoRecordingButtonPosition.BOTTOM_LEFT);
|
|
111
|
+
put("bottomRight", LuciqVideoRecordingButtonPosition.BOTTOM_RIGHT);
|
|
112
|
+
}};
|
|
113
|
+
|
|
114
|
+
static ArgsMap<WelcomeMessage.State> welcomeMessageStates = new ArgsMap<WelcomeMessage.State>() {{
|
|
115
|
+
put("welcomeMessageModeLive", WelcomeMessage.State.LIVE);
|
|
116
|
+
put("welcomeMessageModeBeta", WelcomeMessage.State.BETA);
|
|
117
|
+
put("welcomeMessageModeDisabled", WelcomeMessage.State.DISABLED);
|
|
118
|
+
}};
|
|
119
|
+
|
|
120
|
+
static final ArgsMap<Integer> reportTypes = new ArgsMap<Integer>() {{
|
|
121
|
+
put("bugReportingReportTypeBug", BugReporting.ReportType.BUG);
|
|
122
|
+
put("bugReportingReportTypeFeedback", BugReporting.ReportType.FEEDBACK);
|
|
123
|
+
put("bugReportingReportTypeQuestion", BugReporting.ReportType.QUESTION);
|
|
124
|
+
}};
|
|
125
|
+
|
|
126
|
+
static final ArgsMap<DismissType> dismissTypes = new ArgsMap<DismissType>() {{
|
|
127
|
+
put("dismissTypeSubmit", DismissType.SUBMIT);
|
|
128
|
+
put("dismissTypeCancel", DismissType.CANCEL);
|
|
129
|
+
put("dismissTypeAddAttachment", DismissType.ADD_ATTACHMENT);
|
|
130
|
+
}};
|
|
131
|
+
|
|
132
|
+
static final ArgsMap<Integer> actionTypes = new ArgsMap<Integer>() {{
|
|
133
|
+
put("allActions", ActionType.REQUEST_NEW_FEATURE | ActionType.ADD_COMMENT_TO_FEATURE);
|
|
134
|
+
put("requestNewFeature", ActionType.REQUEST_NEW_FEATURE);
|
|
135
|
+
put("addCommentToFeature", ActionType.ADD_COMMENT_TO_FEATURE);
|
|
136
|
+
}};
|
|
137
|
+
|
|
138
|
+
static ArgsMap<ExtendedBugReport.State> extendedBugReportStates = new ArgsMap<ExtendedBugReport.State>() {{
|
|
139
|
+
put("enabledWithRequiredFields", ExtendedBugReport.State.ENABLED_WITH_REQUIRED_FIELDS);
|
|
140
|
+
put("enabledWithOptionalFields", ExtendedBugReport.State.ENABLED_WITH_OPTIONAL_FIELDS);
|
|
141
|
+
put("disabled", ExtendedBugReport.State.DISABLED);
|
|
142
|
+
}};
|
|
143
|
+
|
|
144
|
+
static final ArgsMap<Integer> reproModes = new ArgsMap<Integer>() {{
|
|
145
|
+
put("reproStepsEnabledWithNoScreenshots", ReproMode.EnableWithNoScreenshots);
|
|
146
|
+
put("reproStepsEnabled", ReproMode.EnableWithScreenshots);
|
|
147
|
+
put("reproStepsDisabled", ReproMode.Disable);
|
|
148
|
+
}};
|
|
149
|
+
|
|
150
|
+
static final ArgsMap<String> userConsentActionType = new ArgsMap<String>() {{
|
|
151
|
+
put("dropAutoCapturedMedia", ai.luciq.bug.userConsent.ActionType.DROP_AUTO_CAPTURED_MEDIA);
|
|
152
|
+
put("dropLogs", ai.luciq.bug.userConsent.ActionType.DROP_LOGS);
|
|
153
|
+
put("noChat", ai.luciq.bug.userConsent.ActionType.NO_CHAT);
|
|
154
|
+
}};
|
|
155
|
+
|
|
156
|
+
static final ArgsMap<Integer> sdkLogLevels = new ArgsMap<Integer>() {{
|
|
157
|
+
put("sdkDebugLogsLevelNone", ai.luciq.library.LogLevel.NONE);
|
|
158
|
+
put("sdkDebugLogsLevelError", ai.luciq.library.LogLevel.ERROR);
|
|
159
|
+
put("sdkDebugLogsLevelDebug", ai.luciq.library.LogLevel.DEBUG);
|
|
160
|
+
put("sdkDebugLogsLevelVerbose", ai.luciq.library.LogLevel.VERBOSE);
|
|
161
|
+
}};
|
|
162
|
+
|
|
163
|
+
static final ArgsMap<LuciqLocale> locales = new ArgsMap<LuciqLocale>() {{
|
|
164
|
+
put("localeArabic", LuciqLocale.ARABIC);
|
|
165
|
+
put("localeAzerbaijani", LuciqLocale.AZERBAIJANI);
|
|
166
|
+
put("localeChineseSimplified", LuciqLocale.SIMPLIFIED_CHINESE);
|
|
167
|
+
put("localeChineseTraditional", LuciqLocale.TRADITIONAL_CHINESE);
|
|
168
|
+
put("localeCzech", LuciqLocale.CZECH);
|
|
169
|
+
put("localeDanish", LuciqLocale.DANISH);
|
|
170
|
+
put("localeDutch", LuciqLocale.NETHERLANDS);
|
|
171
|
+
put("localeEnglish", LuciqLocale.ENGLISH);
|
|
172
|
+
put("localeFrench", LuciqLocale.FRENCH);
|
|
173
|
+
put("localeGerman", LuciqLocale.GERMAN);
|
|
174
|
+
put("localeIndonesian", LuciqLocale.INDONESIAN);
|
|
175
|
+
put("localeItalian", LuciqLocale.ITALIAN);
|
|
176
|
+
put("localeJapanese", LuciqLocale.JAPANESE);
|
|
177
|
+
put("localeKorean", LuciqLocale.KOREAN);
|
|
178
|
+
put("localeNorwegian", LuciqLocale.NORWEGIAN);
|
|
179
|
+
put("localePolish", LuciqLocale.POLISH);
|
|
180
|
+
put("localePortugueseBrazil", LuciqLocale.PORTUGUESE_BRAZIL);
|
|
181
|
+
put("localePortuguesePortugal", LuciqLocale.PORTUGUESE_PORTUGAL);
|
|
182
|
+
put("localeRomanian", LuciqLocale.ROMANIAN);
|
|
183
|
+
put("localeRussian", LuciqLocale.RUSSIAN);
|
|
184
|
+
put("localeSpanish", LuciqLocale.SPANISH);
|
|
185
|
+
put("localeSlovak", LuciqLocale.SLOVAK);
|
|
186
|
+
put("localeSwedish", LuciqLocale.SWEDISH);
|
|
187
|
+
put("localeTurkish", LuciqLocale.TURKISH);
|
|
188
|
+
}};
|
|
189
|
+
|
|
190
|
+
static final ArgsMap<Key> placeholders = new ArgsMap<Key>() {{
|
|
191
|
+
put("shakeHint", Key.SHAKE_HINT);
|
|
192
|
+
put("swipeHint", Key.SWIPE_HINT);
|
|
193
|
+
put("invalidEmailMessage", Key.INVALID_EMAIL_MESSAGE);
|
|
194
|
+
put("emailFieldHint", Key.EMAIL_FIELD_HINT);
|
|
195
|
+
put("commentFieldHintForBugReport", Key.COMMENT_FIELD_HINT_FOR_BUG_REPORT);
|
|
196
|
+
put("commentFieldHintForFeedback", Key.COMMENT_FIELD_HINT_FOR_FEEDBACK);
|
|
197
|
+
put("commentFieldHintForQuestion", Key.COMMENT_FIELD_HINT_FOR_QUESTION);
|
|
198
|
+
put("invocationHeader", Key.INVOCATION_HEADER);
|
|
199
|
+
put("reportQuestion", Key.REPORT_QUESTION);
|
|
200
|
+
put("reportBug", Key.REPORT_BUG);
|
|
201
|
+
put("reportFeedback", Key.REPORT_FEEDBACK);
|
|
202
|
+
put("conversationsHeaderTitle", Key.CONVERSATIONS_LIST_TITLE);
|
|
203
|
+
put("addVoiceMessage", Key.ADD_VOICE_MESSAGE);
|
|
204
|
+
put("addImageFromGallery", Key.ADD_IMAGE_FROM_GALLERY);
|
|
205
|
+
put("addExtraScreenshot", Key.ADD_EXTRA_SCREENSHOT);
|
|
206
|
+
put("addVideoMessage", Key.ADD_VIDEO);
|
|
207
|
+
put("audioRecordingPermissionDeniedMessage", Key.AUDIO_RECORDING_PERMISSION_DENIED);
|
|
208
|
+
put("recordingMessageToHoldText", Key.VOICE_MESSAGE_PRESS_AND_HOLD_TO_RECORD);
|
|
209
|
+
put("recordingMessageToReleaseText", Key.VOICE_MESSAGE_RELEASE_TO_ATTACH);
|
|
210
|
+
put("thankYouText", Key.SUCCESS_DIALOG_HEADER);
|
|
211
|
+
put("videoPressRecord", Key.VIDEO_RECORDING_FAB_BUBBLE_HINT);
|
|
212
|
+
put("conversationTextFieldHint", Key.CONVERSATION_TEXT_FIELD_HINT);
|
|
213
|
+
put("thankYouAlertText", Key.REPORT_SUCCESSFULLY_SENT);
|
|
214
|
+
|
|
215
|
+
put("welcomeMessageBetaWelcomeStepTitle", Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_TITLE);
|
|
216
|
+
put("welcomeMessageBetaWelcomeStepContent", Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_CONTENT);
|
|
217
|
+
put("welcomeMessageBetaHowToReportStepTitle", Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_TITLE);
|
|
218
|
+
put("welcomeMessageBetaHowToReportStepContent", Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_CONTENT);
|
|
219
|
+
put("welcomeMessageBetaFinishStepTitle", Key.BETA_WELCOME_MESSAGE_FINISH_STEP_TITLE);
|
|
220
|
+
put("welcomeMessageBetaFinishStepContent", Key.BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT);
|
|
221
|
+
put("welcomeMessageLiveWelcomeStepTitle", Key.LIVE_WELCOME_MESSAGE_TITLE);
|
|
222
|
+
put("welcomeMessageLiveWelcomeStepContent", Key.LIVE_WELCOME_MESSAGE_CONTENT);
|
|
223
|
+
|
|
224
|
+
put("surveysStoreRatingThanksTitle", Key.SURVEYS_STORE_RATING_THANKS_TITLE);
|
|
225
|
+
put("surveysStoreRatingThanksSubtitle", Key.SURVEYS_STORE_RATING_THANKS_SUBTITLE);
|
|
226
|
+
|
|
227
|
+
put("reportBugDescription", Key.REPORT_BUG_DESCRIPTION);
|
|
228
|
+
put("reportFeedbackDescription", Key.REPORT_FEEDBACK_DESCRIPTION);
|
|
229
|
+
put("reportQuestionDescription", Key.REPORT_QUESTION_DESCRIPTION);
|
|
230
|
+
put("requestFeatureDescription", Key.REQUEST_FEATURE_DESCRIPTION);
|
|
231
|
+
|
|
232
|
+
put("discardAlertTitle", Key.REPORT_DISCARD_DIALOG_TITLE);
|
|
233
|
+
put("discardAlertMessage", Key.REPORT_DISCARD_DIALOG_BODY);
|
|
234
|
+
put("discardAlertStay", Key.REPORT_DISCARD_DIALOG_NEGATIVE_ACTION);
|
|
235
|
+
put("discardAlertDiscard", Key.REPORT_DISCARD_DIALOG_POSITIVE_ACTION);
|
|
236
|
+
|
|
237
|
+
put("addAttachmentButtonTitleStringName", Key.REPORT_ADD_ATTACHMENT_HEADER);
|
|
238
|
+
|
|
239
|
+
put("reportReproStepsDisclaimerBody", Key.REPORT_REPRO_STEPS_DISCLAIMER_BODY);
|
|
240
|
+
put("reportReproStepsDisclaimerLink", Key.REPORT_REPRO_STEPS_DISCLAIMER_LINK);
|
|
241
|
+
put("reproStepsProgressDialogBody", Key.REPRO_STEPS_PROGRESS_DIALOG_BODY);
|
|
242
|
+
put("reproStepsListHeader", Key.REPRO_STEPS_LIST_HEADER);
|
|
243
|
+
put("reproStepsListDescription", Key.REPRO_STEPS_LIST_DESCRIPTION);
|
|
244
|
+
put("reproStepsListEmptyStateDescription", Key.REPRO_STEPS_LIST_EMPTY_STATE_DESCRIPTION);
|
|
245
|
+
put("reproStepsListItemNumberingTitle", Key.REPRO_STEPS_LIST_ITEM_NUMBERING_TITLE);
|
|
246
|
+
put("okButtonTitle", Key.BUG_ATTACHMENT_DIALOG_OK_BUTTON);
|
|
247
|
+
put("audio", Key.CHATS_TYPE_AUDIO);
|
|
248
|
+
put("image", Key.CHATS_TYPE_IMAGE);
|
|
249
|
+
put("screenRecording", Key.CHATS_TYPE_VIDEO);
|
|
250
|
+
put("messagesNotificationAndOthers", Key.CHATS_MULTIPLE_MESSAGE_NOTIFICATION);
|
|
251
|
+
put("team", Key.CHATS_TEAM_STRING_NAME);
|
|
252
|
+
put("insufficientContentMessage", Key.COMMENT_FIELD_INSUFFICIENT_CONTENT);
|
|
253
|
+
}};
|
|
254
|
+
|
|
255
|
+
public static ArgsMap<String> launchType = new ArgsMap<String>() {{
|
|
256
|
+
put("cold", SessionMetadata.LaunchType.COLD);
|
|
257
|
+
put("warm",SessionMetadata.LaunchType.WARM );
|
|
258
|
+
put("unknown","unknown");
|
|
259
|
+
}};
|
|
260
|
+
|
|
261
|
+
public static ArgsMap<Integer> overAirUpdateService = new ArgsMap<Integer>() {{
|
|
262
|
+
put("expo", OverAirVersionType.EXPO);
|
|
263
|
+
put("codePush",OverAirVersionType.CODE_PUSH );
|
|
264
|
+
}};
|
|
265
|
+
|
|
266
|
+
// Temporary workaround to be removed in future release
|
|
267
|
+
// This is used for mapping native `LaunchType` values into React Native enum values.
|
|
268
|
+
public static HashMap<String,String> launchTypeReversed = new HashMap<String,String>() {{
|
|
269
|
+
put(SessionMetadata.LaunchType.COLD,"cold");
|
|
270
|
+
put(SessionMetadata.LaunchType.WARM,"warm" );
|
|
271
|
+
}};
|
|
272
|
+
public static final ArgsMap<Integer> autoMaskingTypes = new ArgsMap<Integer>() {{
|
|
273
|
+
put("labels", MaskingType.LABELS);
|
|
274
|
+
put("textInputs", MaskingType.TEXT_INPUTS);
|
|
275
|
+
put("media", MaskingType.MEDIA);
|
|
276
|
+
put("none", MaskingType.MASK_NOTHING);
|
|
277
|
+
}};
|
|
278
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
final class Constants {
|
|
4
|
+
final static String LCQ_PRE_INVOCATION_HANDLER = "LCQpreInvocationHandler";
|
|
5
|
+
final static String LCQ_POST_INVOCATION_HANDLER = "LCQpostInvocationHandler";
|
|
6
|
+
|
|
7
|
+
final static String LCQ_ON_SHOW_SURVEY_HANDLER = "LCQWillShowSurvey";
|
|
8
|
+
final static String LCQ_ON_DISMISS_SURVEY_HANDLER = "LCQDidDismissSurvey";
|
|
9
|
+
|
|
10
|
+
final static String LCQ_ON_NEW_MESSAGE_HANDLER = "LCQonNewMessageHandler";
|
|
11
|
+
final static String LCQ_ON_NEW_REPLY_RECEIVED_CALLBACK = "LCQOnNewReplyReceivedCallback";
|
|
12
|
+
|
|
13
|
+
final static String LCQ_ON_FEATURES_UPDATED_CALLBACK = "LCQOnFeatureUpdatedCallback";
|
|
14
|
+
final static String LCQ_NETWORK_LOGGER_HANDLER = "LCQNetworkLoggerHandler";
|
|
15
|
+
|
|
16
|
+
final static String LCQ_ON_FEATURE_FLAGS_UPDATE_RECEIVED_CALLBACK = "LCQOnNewFeatureFlagsUpdateReceivedCallback";
|
|
17
|
+
|
|
18
|
+
final static String LCQ_SESSION_REPLAY_ON_SYNC_CALLBACK_INVOCATION = "LCQSessionReplayOnSyncCallback";
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
package ai.luciq.reactlibrary;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import android.util.Log;
|
|
5
|
+
|
|
6
|
+
import androidx.annotation.NonNull;
|
|
7
|
+
import androidx.annotation.VisibleForTesting;
|
|
8
|
+
|
|
9
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
10
|
+
import ai.luciq.apm.APM;
|
|
11
|
+
import ai.luciq.library.Luciq;
|
|
12
|
+
import ai.luciq.library.LogLevel;
|
|
13
|
+
import ai.luciq.library.Platform;
|
|
14
|
+
import ai.luciq.library.invocation.LuciqInvocationEvent;
|
|
15
|
+
import ai.luciq.reactlibrary.utils.LuciqUtil;
|
|
16
|
+
|
|
17
|
+
import java.lang.reflect.Method;
|
|
18
|
+
|
|
19
|
+
public class RNLuciq {
|
|
20
|
+
|
|
21
|
+
private static RNLuciq instance;
|
|
22
|
+
|
|
23
|
+
private RNLuciq() {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
public static RNLuciq getInstance() {
|
|
28
|
+
if (instance == null) {
|
|
29
|
+
synchronized (RNLuciq.class) {
|
|
30
|
+
if (instance == null) {
|
|
31
|
+
instance = new RNLuciq();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return instance;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Initializes the SDK on the native side, which is useful for capturing startup issues specific to the native part of the app.
|
|
40
|
+
*
|
|
41
|
+
* @param application The application context.
|
|
42
|
+
* @param applicationToken The app's identifying token, available on your dashboard.
|
|
43
|
+
* @param logLevel The level of detail in logs that you want to print.
|
|
44
|
+
* <p>Pick one of the log levels described in {@link LogLevel}.
|
|
45
|
+
* default logLevel is {@link LogLevel#ERROR}</p>
|
|
46
|
+
* @param InvocationEvent The events that trigger the SDK's user interface.
|
|
47
|
+
* Choose from the available events listed in {@link LuciqInvocationEvent}.
|
|
48
|
+
* @example <p>Here's an example usage: </p>
|
|
49
|
+
* <blockquote><pre>
|
|
50
|
+
* RNLuciq.getInstance().init(
|
|
51
|
+
* this,
|
|
52
|
+
* "your_token_here",
|
|
53
|
+
* LogLevel.VERBOSE,
|
|
54
|
+
* LuciqInvocationEvent.SHAKE,
|
|
55
|
+
* ... // Other invocation events
|
|
56
|
+
* );
|
|
57
|
+
* </pre></blockquote>
|
|
58
|
+
*/
|
|
59
|
+
public void init(
|
|
60
|
+
@NonNull Application application,
|
|
61
|
+
@NonNull String applicationToken,
|
|
62
|
+
int logLevel,
|
|
63
|
+
String codePushVersion,
|
|
64
|
+
String appVariant,
|
|
65
|
+
Boolean ignoreSecureFlag,
|
|
66
|
+
@NonNull LuciqInvocationEvent... InvocationEvent
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
) {
|
|
70
|
+
try {
|
|
71
|
+
|
|
72
|
+
setBaseUrlForDeprecationLogs();
|
|
73
|
+
setCurrentPlatform();
|
|
74
|
+
|
|
75
|
+
Luciq.Builder builder= new Luciq.Builder(application, applicationToken)
|
|
76
|
+
.setInvocationEvents(InvocationEvent)
|
|
77
|
+
.setSdkDebugLogsLevel(logLevel);
|
|
78
|
+
|
|
79
|
+
if(codePushVersion!=null){
|
|
80
|
+
builder.setCodePushVersion(codePushVersion);
|
|
81
|
+
}
|
|
82
|
+
if(appVariant!=null)
|
|
83
|
+
builder.setAppVariant(appVariant);
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if (ignoreSecureFlag != null) {
|
|
88
|
+
builder.ignoreFlagSecure(ignoreSecureFlag);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
builder.build();
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// Temporarily disabling APM hot launches
|
|
95
|
+
APM.setHotAppLaunchEnabled(false);
|
|
96
|
+
} catch (Exception e) {
|
|
97
|
+
e.printStackTrace();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Initializes the SDK on the native side, which is useful for capturing startup issues specific to the native part of the app.
|
|
105
|
+
*
|
|
106
|
+
* @param application The application context.
|
|
107
|
+
* @param applicationToken The app's identifying token, available on your dashboard.
|
|
108
|
+
* @param invocationEvent The events that trigger the SDK's user interface.
|
|
109
|
+
* Choose from the available events listed in {@link LuciqInvocationEvent}.
|
|
110
|
+
* @example <p>Here's an example usage: </p>
|
|
111
|
+
* <blockquote><pre>
|
|
112
|
+
* RNLuciq.getInstance().init(
|
|
113
|
+
* this,
|
|
114
|
+
* "your_token_here",
|
|
115
|
+
* LuciqInvocationEvent.SHAKE,
|
|
116
|
+
* ... // Other invocation events
|
|
117
|
+
* );
|
|
118
|
+
* </pre></blockquote>
|
|
119
|
+
*/
|
|
120
|
+
public void init(
|
|
121
|
+
@NonNull Application application,
|
|
122
|
+
@NonNull String applicationToken,
|
|
123
|
+
String codePushVersion,
|
|
124
|
+
String appVariant,
|
|
125
|
+
@NonNull LuciqInvocationEvent... invocationEvent
|
|
126
|
+
) {
|
|
127
|
+
init(application, applicationToken, LogLevel.ERROR,codePushVersion,appVariant, null,invocationEvent);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@VisibleForTesting
|
|
131
|
+
public void setCurrentPlatform() {
|
|
132
|
+
try {
|
|
133
|
+
Method method = LuciqUtil.getMethod(Class.forName("ai.luciq.library.Luciq"), "setCurrentPlatform", int.class);
|
|
134
|
+
if (method != null) {
|
|
135
|
+
Log.i("LCQ-CP-Bridge", "invoking setCurrentPlatform with platform: " + Platform.RN);
|
|
136
|
+
method.invoke(null, Platform.RN);
|
|
137
|
+
} else {
|
|
138
|
+
Log.e("LCQ-CP-Bridge", "setCurrentPlatform was not found by reflection");
|
|
139
|
+
}
|
|
140
|
+
} catch (Exception e) {
|
|
141
|
+
e.printStackTrace();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@VisibleForTesting
|
|
146
|
+
public void setBaseUrlForDeprecationLogs() {
|
|
147
|
+
try {
|
|
148
|
+
Method method = LuciqUtil.getMethod(Class.forName("ai.luciq.library.util.InstabugDeprecationLogger"), "setBaseUrl", String.class);
|
|
149
|
+
if (method != null) {
|
|
150
|
+
method.invoke(null, "https://docs.luciq.ai/docs/react-native-sdk-migration-guide");
|
|
151
|
+
}
|
|
152
|
+
} catch (Exception e) {
|
|
153
|
+
e.printStackTrace();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public static class Builder {
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Application instance to initialize Luciq.
|
|
161
|
+
*/
|
|
162
|
+
private Application application;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The application token obtained from the Luciq dashboard.
|
|
166
|
+
*/
|
|
167
|
+
private String applicationToken;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The level of detail in logs that you want to print.
|
|
171
|
+
*/
|
|
172
|
+
private int logLevel = LogLevel.ERROR;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The Code Push version to be used for all reports.
|
|
176
|
+
*/
|
|
177
|
+
private String codePushVersion;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The overAirUpdate Version to be used for all reports.
|
|
181
|
+
*/
|
|
182
|
+
private ReadableMap overAirVersion;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The events that trigger the SDK's user interface.
|
|
186
|
+
*/
|
|
187
|
+
private LuciqInvocationEvent[] invocationEvents;
|
|
188
|
+
/**
|
|
189
|
+
* The App variant name to be used for all reports.
|
|
190
|
+
*/
|
|
191
|
+
private String appVariant;
|
|
192
|
+
|
|
193
|
+
private Boolean ignoreFlagSecure;
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Initialize Luciq SDK with application token
|
|
198
|
+
*
|
|
199
|
+
* @param application Application object for initialization of library
|
|
200
|
+
* @param applicationToken The app's identifying token, available on your dashboard.
|
|
201
|
+
*/
|
|
202
|
+
public Builder(Application application, String applicationToken) {
|
|
203
|
+
this.application = application;
|
|
204
|
+
this.applicationToken = applicationToken;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Initialize Luciq SDK with application token and invocation trigger events
|
|
209
|
+
*
|
|
210
|
+
* @param application Application object for initialization of library
|
|
211
|
+
* @param applicationToken The app's identifying token, available on your dashboard.
|
|
212
|
+
* @param invocationEvents The events that trigger the SDK's user interface.
|
|
213
|
+
* <p>Choose from the available events listed in {@link LuciqInvocationEvent}.</p>
|
|
214
|
+
*/
|
|
215
|
+
public Builder(Application application, String applicationToken, LuciqInvocationEvent... invocationEvents) {
|
|
216
|
+
this.application = application;
|
|
217
|
+
this.applicationToken = applicationToken;
|
|
218
|
+
this.invocationEvents = invocationEvents;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Sets the filtering level for printed SDK logs.
|
|
223
|
+
*
|
|
224
|
+
* @param logLevel The log filtering level to be set.
|
|
225
|
+
* Choose from {@link LogLevel} constants:
|
|
226
|
+
* {@link LogLevel#NONE}, {@link LogLevel#ERROR}, {@link LogLevel#DEBUG}, or {@link LogLevel#VERBOSE}.
|
|
227
|
+
* <p>Default level is {@link LogLevel#ERROR}.</p>
|
|
228
|
+
*/
|
|
229
|
+
public Builder setLogLevel(int logLevel) {
|
|
230
|
+
this.logLevel = logLevel;
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Sets Code Push version to be used for all reports.
|
|
236
|
+
*
|
|
237
|
+
* @param codePushVersion the Code Push version to work with.
|
|
238
|
+
*/
|
|
239
|
+
public Builder setCodePushVersion(String codePushVersion) {
|
|
240
|
+
this.codePushVersion = codePushVersion;
|
|
241
|
+
return this;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Sets over air update version to be used for all reports.
|
|
246
|
+
*
|
|
247
|
+
* @param overAirVersion the over air update version and service map.
|
|
248
|
+
*/
|
|
249
|
+
public Builder setOverAirVersion(ReadableMap overAirVersion) {
|
|
250
|
+
this.overAirVersion = overAirVersion;
|
|
251
|
+
return this;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Sets flag to override SDK screenshot security behavior.
|
|
256
|
+
*
|
|
257
|
+
* @param ignoreFlagSecure flag to override SDK screenshot security behavior.
|
|
258
|
+
*/
|
|
259
|
+
public Builder ignoreFlagSecure(boolean ignoreFlagSecure) {
|
|
260
|
+
this.ignoreFlagSecure = ignoreFlagSecure;
|
|
261
|
+
return this;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Sets the invocation triggering events for the SDK's user interface
|
|
266
|
+
*
|
|
267
|
+
* @param invocationEvents The events that trigger the SDK's user interface.
|
|
268
|
+
* Choose from the available events listed in {@link LuciqInvocationEvent}.
|
|
269
|
+
*/
|
|
270
|
+
public Builder setInvocationEvents(LuciqInvocationEvent... invocationEvents) {
|
|
271
|
+
this.invocationEvents = invocationEvents;
|
|
272
|
+
return this;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Sets the the current App variant
|
|
277
|
+
*
|
|
278
|
+
* @param appVariant the current App variant to work with.
|
|
279
|
+
*/
|
|
280
|
+
public Builder setAppVariant(String appVariant) {
|
|
281
|
+
this.appVariant = appVariant;
|
|
282
|
+
return this;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Builds the Luciq instance with the provided configurations.
|
|
287
|
+
*/
|
|
288
|
+
public void build() {
|
|
289
|
+
try {
|
|
290
|
+
RNLuciq.getInstance().setBaseUrlForDeprecationLogs();
|
|
291
|
+
RNLuciq.getInstance().setCurrentPlatform();
|
|
292
|
+
|
|
293
|
+
Luciq.Builder luciqBuilder = new Luciq.Builder(application, applicationToken)
|
|
294
|
+
.setInvocationEvents(invocationEvents)
|
|
295
|
+
.setSdkDebugLogsLevel(logLevel);
|
|
296
|
+
|
|
297
|
+
if (codePushVersion != null) {
|
|
298
|
+
luciqBuilder.setCodePushVersion(codePushVersion);
|
|
299
|
+
}
|
|
300
|
+
if(appVariant!=null){
|
|
301
|
+
luciqBuilder.setAppVariant(appVariant);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (ignoreFlagSecure != null) {
|
|
305
|
+
luciqBuilder.ignoreFlagSecure(ignoreFlagSecure);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (overAirVersion != null ) {
|
|
309
|
+
if (overAirVersion.hasKey("service") && overAirVersion.hasKey("version"))
|
|
310
|
+
{
|
|
311
|
+
if (overAirVersion.getString("service")!=null && overAirVersion.getString("version")!=null)
|
|
312
|
+
{
|
|
313
|
+
luciqBuilder.setOverAirVersion(overAirVersion.getString("version"),
|
|
314
|
+
ArgsRegistry.overAirUpdateService.get(overAirVersion.getString("service")));
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
luciqBuilder.build();
|
|
320
|
+
|
|
321
|
+
// Temporarily disabling APM hot launches
|
|
322
|
+
APM.setHotAppLaunchEnabled(false);
|
|
323
|
+
} catch (Exception e) {
|
|
324
|
+
e.printStackTrace();
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|