@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,55 @@
|
|
|
1
|
+
import type { LaunchType } from '../utils/Enums';
|
|
2
|
+
/**
|
|
3
|
+
* network log item
|
|
4
|
+
*/
|
|
5
|
+
export interface NetworkLog {
|
|
6
|
+
url: string;
|
|
7
|
+
duration: number;
|
|
8
|
+
statusCode: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SessionMetadata {
|
|
11
|
+
/**
|
|
12
|
+
* app version of the session
|
|
13
|
+
*/
|
|
14
|
+
appVersion: string;
|
|
15
|
+
/**
|
|
16
|
+
* operating system of the session
|
|
17
|
+
*/
|
|
18
|
+
OS: string;
|
|
19
|
+
/**
|
|
20
|
+
* mobile device model of the session
|
|
21
|
+
*/
|
|
22
|
+
device: string;
|
|
23
|
+
/**
|
|
24
|
+
* session duration in seconds
|
|
25
|
+
*/
|
|
26
|
+
sessionDurationInSeconds: number;
|
|
27
|
+
/**
|
|
28
|
+
* list of netwrok requests occurred during the session
|
|
29
|
+
*/
|
|
30
|
+
networkLogs: NetworkLog[];
|
|
31
|
+
/**
|
|
32
|
+
* launch type of the session
|
|
33
|
+
*/
|
|
34
|
+
launchType: LaunchType;
|
|
35
|
+
/**
|
|
36
|
+
* is an in-app review occurred in the previous session.
|
|
37
|
+
*/
|
|
38
|
+
hasLinkToAppReview: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* app launch duration
|
|
41
|
+
*/
|
|
42
|
+
launchDuration: number;
|
|
43
|
+
/**
|
|
44
|
+
* number of bugs in the session (iOS only)
|
|
45
|
+
*/
|
|
46
|
+
bugsCount?: number;
|
|
47
|
+
/**
|
|
48
|
+
* number of fetal crashes in the session (iOS only)
|
|
49
|
+
*/
|
|
50
|
+
fatalCrashCount?: number;
|
|
51
|
+
/**
|
|
52
|
+
* number of out of memory crashes in the session (iOS only)
|
|
53
|
+
*/
|
|
54
|
+
oomCrashCount?: number;
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type ThemeConfig = {
|
|
2
|
+
primaryColor?: string;
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
titleTextColor?: string;
|
|
5
|
+
subtitleTextColor?: string;
|
|
6
|
+
primaryTextColor?: string;
|
|
7
|
+
secondaryTextColor?: string;
|
|
8
|
+
callToActionTextColor?: string;
|
|
9
|
+
headerBackgroundColor?: string;
|
|
10
|
+
footerBackgroundColor?: string;
|
|
11
|
+
rowBackgroundColor?: string;
|
|
12
|
+
selectedRowBackgroundColor?: string;
|
|
13
|
+
rowSeparatorColor?: string;
|
|
14
|
+
primaryTextStyle?: 'bold' | 'italic' | 'normal';
|
|
15
|
+
secondaryTextStyle?: 'bold' | 'italic' | 'normal';
|
|
16
|
+
titleTextStyle?: 'bold' | 'italic' | 'normal';
|
|
17
|
+
ctaTextStyle?: 'bold' | 'italic' | 'normal';
|
|
18
|
+
primaryFontPath?: string;
|
|
19
|
+
primaryFontAsset?: string;
|
|
20
|
+
secondaryFontPath?: string;
|
|
21
|
+
secondaryFontAsset?: string;
|
|
22
|
+
ctaFontPath?: string;
|
|
23
|
+
ctaFontAsset?: string;
|
|
24
|
+
primaryTextType?: string;
|
|
25
|
+
secondaryTextType?: string;
|
|
26
|
+
ctaTextType?: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type W3cExternalTraceAttributes = {
|
|
2
|
+
/**
|
|
3
|
+
* A key that determines if the traceparent header was found
|
|
4
|
+
*/
|
|
5
|
+
isW3cHeaderFound: boolean | null;
|
|
6
|
+
/**
|
|
7
|
+
* A unique identifier for the trace generated by the SDK in case of no cought header found
|
|
8
|
+
*/
|
|
9
|
+
partialId: number | null;
|
|
10
|
+
/**
|
|
11
|
+
* The start time of the network request
|
|
12
|
+
*/
|
|
13
|
+
networkStartTimeInSeconds: number | null;
|
|
14
|
+
/**
|
|
15
|
+
* The traceparent header generated by the SDK
|
|
16
|
+
*/
|
|
17
|
+
w3cGeneratedHeader: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* The traceparent header received by the server
|
|
20
|
+
*/
|
|
21
|
+
w3cCaughtHeader: string | null;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enables or disables APM
|
|
3
|
+
* @param isEnabled
|
|
4
|
+
*/
|
|
5
|
+
export declare const setEnabled: (isEnabled: boolean) => void;
|
|
6
|
+
/**
|
|
7
|
+
* If APM is enabled, Luciq SDK starts collecting data about the app launch time by default.
|
|
8
|
+
* This API is used to give user more control over this behavior.
|
|
9
|
+
* @param isEnabled
|
|
10
|
+
*/
|
|
11
|
+
export declare const setAppLaunchEnabled: (isEnabled: boolean) => void;
|
|
12
|
+
/**
|
|
13
|
+
* To define when an app launch is complete,
|
|
14
|
+
* such as when it's intractable, use the end app launch API.
|
|
15
|
+
* You can then view this data with the automatic cold app launch.
|
|
16
|
+
*/
|
|
17
|
+
export declare const endAppLaunch: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Enables or disables APM Network Metric
|
|
20
|
+
* @param isEnabled - a boolean indicates either iOS monitoring is enabled or disabled.
|
|
21
|
+
*/
|
|
22
|
+
export declare const setNetworkEnabledIOS: (isEnabled: boolean) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Enables or disables APM UI Responsiveness tracking feature
|
|
25
|
+
* @param isEnabled
|
|
26
|
+
*/
|
|
27
|
+
export declare const setAutoUITraceEnabled: (isEnabled: boolean) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Starts an AppFlow with the specified name.
|
|
30
|
+
*
|
|
31
|
+
* On starting two flows with the same name, the older flow will end with a force abandon end reason.
|
|
32
|
+
* The AppFlow name cannot exceed 150 characters; otherwise, it's truncated,
|
|
33
|
+
* leading and trailing whitespaces are also ignored.
|
|
34
|
+
*
|
|
35
|
+
* @param name - The name of the AppFlow. It cannot be an empty string or null.
|
|
36
|
+
* A new AppFlow is started if APM is enabled, the feature is enabled,
|
|
37
|
+
* and the Luciq SDK is initialized.
|
|
38
|
+
*/
|
|
39
|
+
export declare const startFlow: (name: string) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Ends an AppFlow with the given name.
|
|
42
|
+
*
|
|
43
|
+
* @param name - The name of the AppFlow to end. It cannot be an empty string or null.
|
|
44
|
+
*/
|
|
45
|
+
export declare const endFlow: (name: string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Sets custom attributes for an AppFlow with a given name.
|
|
48
|
+
*
|
|
49
|
+
* Setting an attribute value to null will remove the corresponding key if it already exists.
|
|
50
|
+
* Attribute keys cannot exceed 30 characters and leading/trailing whitespaces are ignored.
|
|
51
|
+
* Empty strings or null for attribute keys are not accepted.
|
|
52
|
+
*
|
|
53
|
+
* Attribute values cannot exceed 60 characters and leading/trailing whitespaces are ignored.
|
|
54
|
+
* Empty strings for attribute values are not accepted, but null can be used to remove an attribute.
|
|
55
|
+
*
|
|
56
|
+
* If an AppFlow is ended, attributes will not be added and existing ones will not be updated.
|
|
57
|
+
*
|
|
58
|
+
* @param name - The name of the AppFlow. It cannot be an empty string or null.
|
|
59
|
+
* @param key - The key of the attribute. It cannot be an empty string or null.
|
|
60
|
+
* @param [value] - The value of the attribute. It cannot be an empty string. Use null to remove the attribute.
|
|
61
|
+
*/
|
|
62
|
+
export declare const setFlowAttribute: (name: string, key: string, value?: string | null) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Initiates a UI trace with the specified name using a native module.
|
|
65
|
+
* @param {string} name - The `name` parameter in the `startUITrace` function is a string that
|
|
66
|
+
* represents the name of the UI trace that you want to start. This name is used to identify and track
|
|
67
|
+
* the specific UI trace within the application.
|
|
68
|
+
*/
|
|
69
|
+
export declare const startUITrace: (name: string) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Ends the currently running custom trace.
|
|
72
|
+
*/
|
|
73
|
+
export declare const endUITrace: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Used for internal testing.
|
|
76
|
+
*/
|
|
77
|
+
export declare const _lcqSleep: () => void;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { NativeAPM } from '../native/NativeAPM';
|
|
3
|
+
import { NativeLuciq } from '../native/NativeLuciq';
|
|
4
|
+
/**
|
|
5
|
+
* Enables or disables APM
|
|
6
|
+
* @param isEnabled
|
|
7
|
+
*/
|
|
8
|
+
export const setEnabled = (isEnabled) => {
|
|
9
|
+
NativeAPM.setEnabled(isEnabled);
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* If APM is enabled, Luciq SDK starts collecting data about the app launch time by default.
|
|
13
|
+
* This API is used to give user more control over this behavior.
|
|
14
|
+
* @param isEnabled
|
|
15
|
+
*/
|
|
16
|
+
export const setAppLaunchEnabled = (isEnabled) => {
|
|
17
|
+
NativeAPM.setAppLaunchEnabled(isEnabled);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* To define when an app launch is complete,
|
|
21
|
+
* such as when it's intractable, use the end app launch API.
|
|
22
|
+
* You can then view this data with the automatic cold app launch.
|
|
23
|
+
*/
|
|
24
|
+
export const endAppLaunch = () => {
|
|
25
|
+
NativeAPM.endAppLaunch();
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Enables or disables APM Network Metric
|
|
29
|
+
* @param isEnabled - a boolean indicates either iOS monitoring is enabled or disabled.
|
|
30
|
+
*/
|
|
31
|
+
export const setNetworkEnabledIOS = (isEnabled) => {
|
|
32
|
+
if (Platform.OS === 'ios') {
|
|
33
|
+
NativeLuciq.setNetworkLoggingEnabled(isEnabled);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Enables or disables APM UI Responsiveness tracking feature
|
|
38
|
+
* @param isEnabled
|
|
39
|
+
*/
|
|
40
|
+
export const setAutoUITraceEnabled = (isEnabled) => {
|
|
41
|
+
NativeAPM.setAutoUITraceEnabled(isEnabled);
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Starts an AppFlow with the specified name.
|
|
45
|
+
*
|
|
46
|
+
* On starting two flows with the same name, the older flow will end with a force abandon end reason.
|
|
47
|
+
* The AppFlow name cannot exceed 150 characters; otherwise, it's truncated,
|
|
48
|
+
* leading and trailing whitespaces are also ignored.
|
|
49
|
+
*
|
|
50
|
+
* @param name - The name of the AppFlow. It cannot be an empty string or null.
|
|
51
|
+
* A new AppFlow is started if APM is enabled, the feature is enabled,
|
|
52
|
+
* and the Luciq SDK is initialized.
|
|
53
|
+
*/
|
|
54
|
+
export const startFlow = (name) => {
|
|
55
|
+
NativeAPM.startFlow(name);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Ends an AppFlow with the given name.
|
|
59
|
+
*
|
|
60
|
+
* @param name - The name of the AppFlow to end. It cannot be an empty string or null.
|
|
61
|
+
*/
|
|
62
|
+
export const endFlow = (name) => {
|
|
63
|
+
NativeAPM.endFlow(name);
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Sets custom attributes for an AppFlow with a given name.
|
|
67
|
+
*
|
|
68
|
+
* Setting an attribute value to null will remove the corresponding key if it already exists.
|
|
69
|
+
* Attribute keys cannot exceed 30 characters and leading/trailing whitespaces are ignored.
|
|
70
|
+
* Empty strings or null for attribute keys are not accepted.
|
|
71
|
+
*
|
|
72
|
+
* Attribute values cannot exceed 60 characters and leading/trailing whitespaces are ignored.
|
|
73
|
+
* Empty strings for attribute values are not accepted, but null can be used to remove an attribute.
|
|
74
|
+
*
|
|
75
|
+
* If an AppFlow is ended, attributes will not be added and existing ones will not be updated.
|
|
76
|
+
*
|
|
77
|
+
* @param name - The name of the AppFlow. It cannot be an empty string or null.
|
|
78
|
+
* @param key - The key of the attribute. It cannot be an empty string or null.
|
|
79
|
+
* @param [value] - The value of the attribute. It cannot be an empty string. Use null to remove the attribute.
|
|
80
|
+
*/
|
|
81
|
+
export const setFlowAttribute = (name, key, value) => {
|
|
82
|
+
NativeAPM.setFlowAttribute(name, key, value);
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Initiates a UI trace with the specified name using a native module.
|
|
86
|
+
* @param {string} name - The `name` parameter in the `startUITrace` function is a string that
|
|
87
|
+
* represents the name of the UI trace that you want to start. This name is used to identify and track
|
|
88
|
+
* the specific UI trace within the application.
|
|
89
|
+
*/
|
|
90
|
+
export const startUITrace = (name) => {
|
|
91
|
+
NativeAPM.startUITrace(name);
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Ends the currently running custom trace.
|
|
95
|
+
*/
|
|
96
|
+
export const endUITrace = () => {
|
|
97
|
+
NativeAPM.endUITrace();
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Used for internal testing.
|
|
101
|
+
*/
|
|
102
|
+
export const _lcqSleep = () => {
|
|
103
|
+
NativeAPM.lcqSleep();
|
|
104
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { DismissType, ExtendedBugReportMode, FloatingButtonPosition, InvocationEvent, InvocationOption, RecordingButtonPosition, ReportType, userConsentActionType } from '../utils/Enums';
|
|
2
|
+
/**
|
|
3
|
+
* Enables and disables manual invocation and prompt options for bug and feedback.
|
|
4
|
+
* @param isEnabled
|
|
5
|
+
*/
|
|
6
|
+
export declare const setEnabled: (isEnabled: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Sets the events that invoke the feedback form.
|
|
9
|
+
* Default is set by `Luciq.init`.
|
|
10
|
+
* @param events Array of events that invokes the feedback form.
|
|
11
|
+
*/
|
|
12
|
+
export declare const setInvocationEvents: (events: InvocationEvent[]) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the invocation options.
|
|
15
|
+
* Default is set by `Luciq.init`.
|
|
16
|
+
* @param options Array of invocation options
|
|
17
|
+
*/
|
|
18
|
+
export declare const setOptions: (options: InvocationOption[]) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Sets a block of code to be executed just before the SDK's UI is presented.
|
|
21
|
+
* This block is executed on the UI thread. Could be used for performing any
|
|
22
|
+
* UI changes before the SDK's UI is shown.
|
|
23
|
+
* @param handler A callback that gets executed before invoking the SDK
|
|
24
|
+
*/
|
|
25
|
+
export declare const onInvokeHandler: (handler: () => void) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Sets a block of code to be executed right after the SDK's UI is dismissed.
|
|
28
|
+
* This block is executed on the UI thread. Could be used for performing any
|
|
29
|
+
* UI changes after the SDK's UI is dismissed.
|
|
30
|
+
* @param handler A callback to get executed after dismissing the SDK.
|
|
31
|
+
*/
|
|
32
|
+
export declare const onSDKDismissedHandler: (handler: (dismissType: DismissType, reportType: ReportType) => void) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the threshold value of the shake gesture for iPhone/iPod Touch
|
|
35
|
+
* Default for iPhone is 2.5.
|
|
36
|
+
* @param threshold Threshold for iPhone.
|
|
37
|
+
*/
|
|
38
|
+
export declare const setShakingThresholdForiPhone: (threshold: number) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the threshold value of the shake gesture for iPad.
|
|
41
|
+
* Default for iPad is 0.6.
|
|
42
|
+
* @param threshold Threshold for iPad.
|
|
43
|
+
*/
|
|
44
|
+
export declare const setShakingThresholdForiPad: (threshold: number) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the threshold value of the shake gesture for android devices.
|
|
47
|
+
* Default for android is an integer value equals 350.
|
|
48
|
+
* you could increase the shaking difficulty level by
|
|
49
|
+
* increasing the `350` value and vice versa
|
|
50
|
+
* @param threshold Threshold for android devices.
|
|
51
|
+
*/
|
|
52
|
+
export declare const setShakingThresholdForAndroid: (threshold: number) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Sets whether the extended bug report mode should be disabled, enabled with
|
|
55
|
+
* required fields or enabled with optional fields.
|
|
56
|
+
* @param mode An enum to disable the extended bug report mode,
|
|
57
|
+
* enable it with required or with optional fields.
|
|
58
|
+
*/
|
|
59
|
+
export declare const setExtendedBugReportMode: (mode: ExtendedBugReportMode) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Sets what type of reports, bug or feedback, should be invoked.
|
|
62
|
+
* @param types Array of reportTypes
|
|
63
|
+
*/
|
|
64
|
+
export declare const setReportTypes: (types: ReportType[]) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Invoke bug reporting with report type and options.
|
|
67
|
+
* @param type
|
|
68
|
+
* @param options
|
|
69
|
+
*/
|
|
70
|
+
export declare const show: (type: ReportType, options: InvocationOption[]) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Enable/Disable screen recording
|
|
73
|
+
* @param isEnabled enable/disable screen recording on crash feature
|
|
74
|
+
*/
|
|
75
|
+
export declare const setAutoScreenRecordingEnabled: (isEnabled: boolean) => void;
|
|
76
|
+
/**
|
|
77
|
+
* Sets auto screen recording maximum duration
|
|
78
|
+
*
|
|
79
|
+
* @param maxDuration maximum duration of the screen recording video in seconds.
|
|
80
|
+
* The maximum duration is 30 seconds
|
|
81
|
+
*/
|
|
82
|
+
export declare const setAutoScreenRecordingDurationIOS: (maxDuration: number) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the default position at which the Luciq screen recording button will be shown.
|
|
85
|
+
* Different orientations are already handled.
|
|
86
|
+
* (Default for `position` is `bottomRight`)
|
|
87
|
+
*
|
|
88
|
+
* @param buttonPosition is of type position `topLeft` to show on the top left
|
|
89
|
+
* of screen, or `bottomRight` to show on the bottom right of screen.
|
|
90
|
+
*/
|
|
91
|
+
export declare const setVideoRecordingFloatingButtonPosition: (buttonPosition: RecordingButtonPosition) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Enables/disables inspect view hierarchy when reporting a bug/feedback.
|
|
94
|
+
* @param isEnabled A boolean to set whether view hierarchy are enabled or disabled.
|
|
95
|
+
*/
|
|
96
|
+
export declare const setViewHierarchyEnabled: (isEnabled: boolean) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Adds a user consent item to the bug reporting form.
|
|
99
|
+
* @param key A unique identifier string for the consent item.
|
|
100
|
+
* @param description The text shown to the user describing the consent item.
|
|
101
|
+
* @param mandatory Whether the user must agree to this item before submitting a report.
|
|
102
|
+
* @param checked Whether the consent checkbox is pre-selected.
|
|
103
|
+
* @param actionType A string representing the action type to map to SDK behavior.
|
|
104
|
+
*/
|
|
105
|
+
export declare const addUserConsent: (key: string, description: string, mandatory: boolean, checked: boolean, actionType?: userConsentActionType) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Sets a block of code to be executed when a prompt option is selected.
|
|
108
|
+
* @param handler - A callback that gets executed when a prompt option is selected.
|
|
109
|
+
*/
|
|
110
|
+
export declare const setDidSelectPromptOptionHandler: (handler: (promptOption: string) => void) => void;
|
|
111
|
+
/**
|
|
112
|
+
* Sets the default edge and offset from the top at which the floating button
|
|
113
|
+
* will be shown. Different orientations are already handled.
|
|
114
|
+
* @param edge The screen edge to show the floating button onto. Default is `floatingButtonEdge.right`.
|
|
115
|
+
* @param offset The offset of the floating button from the top of the screen. Default is 50.
|
|
116
|
+
*/
|
|
117
|
+
export declare const setFloatingButtonEdge: (edge: FloatingButtonPosition, offset: number) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Sets whether attachments in bug reporting and in-app messaging are enabled or not.
|
|
120
|
+
* @param screenshot A boolean to enable or disable screenshot attachments.
|
|
121
|
+
* @param extraScreenshot A boolean to enable or disable extra screenshot attachments.
|
|
122
|
+
* @param galleryImage A boolean to enable or disable gallery image attachments. In iOS 10+,
|
|
123
|
+
* NSPhotoLibraryUsageDescription should be set in info.plist to enable gallery image attachments.
|
|
124
|
+
* @param screenRecording A boolean to enable or disable screen recording attachments.
|
|
125
|
+
*/
|
|
126
|
+
export declare const setEnabledAttachmentTypes: (screenshot: boolean, extraScreenshot: boolean, galleryImage: boolean, screenRecording: boolean) => void;
|
|
127
|
+
/**
|
|
128
|
+
* Adds a disclaimer text within the bug reporting form, which can include hyperlinked text.
|
|
129
|
+
* @param text String text.
|
|
130
|
+
*/
|
|
131
|
+
export declare const setDisclaimerText: (text: string) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Sets a minimum number of characters as a requirement for the comments field in the different report types.
|
|
134
|
+
* @param limit int number of characters.
|
|
135
|
+
* @param reportTypes (Optional) Array of reportType. If it's not passed, the limit will apply to all report types.
|
|
136
|
+
* @platform iOS
|
|
137
|
+
*/
|
|
138
|
+
export declare const setCommentMinimumCharacterCount: (limit: number, reportTypes?: ReportType[]) => void;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { NativeBugReporting, NativeEvents, emitter } from '../native/NativeBugReporting';
|
|
3
|
+
/**
|
|
4
|
+
* Enables and disables manual invocation and prompt options for bug and feedback.
|
|
5
|
+
* @param isEnabled
|
|
6
|
+
*/
|
|
7
|
+
export const setEnabled = (isEnabled) => {
|
|
8
|
+
NativeBugReporting.setEnabled(isEnabled);
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Sets the events that invoke the feedback form.
|
|
12
|
+
* Default is set by `Luciq.init`.
|
|
13
|
+
* @param events Array of events that invokes the feedback form.
|
|
14
|
+
*/
|
|
15
|
+
export const setInvocationEvents = (events) => {
|
|
16
|
+
NativeBugReporting.setInvocationEvents(events);
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Sets the invocation options.
|
|
20
|
+
* Default is set by `Luciq.init`.
|
|
21
|
+
* @param options Array of invocation options
|
|
22
|
+
*/
|
|
23
|
+
export const setOptions = (options) => {
|
|
24
|
+
NativeBugReporting.setOptions(options);
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Sets a block of code to be executed just before the SDK's UI is presented.
|
|
28
|
+
* This block is executed on the UI thread. Could be used for performing any
|
|
29
|
+
* UI changes before the SDK's UI is shown.
|
|
30
|
+
* @param handler A callback that gets executed before invoking the SDK
|
|
31
|
+
*/
|
|
32
|
+
export const onInvokeHandler = (handler) => {
|
|
33
|
+
emitter.addListener(NativeEvents.ON_INVOKE_HANDLER, handler);
|
|
34
|
+
NativeBugReporting.setOnInvokeHandler(handler);
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Sets a block of code to be executed right after the SDK's UI is dismissed.
|
|
38
|
+
* This block is executed on the UI thread. Could be used for performing any
|
|
39
|
+
* UI changes after the SDK's UI is dismissed.
|
|
40
|
+
* @param handler A callback to get executed after dismissing the SDK.
|
|
41
|
+
*/
|
|
42
|
+
export const onSDKDismissedHandler = (handler) => {
|
|
43
|
+
emitter.addListener(NativeEvents.ON_DISMISS_HANDLER, (payload) => {
|
|
44
|
+
handler(payload.dismissType, payload.reportType);
|
|
45
|
+
});
|
|
46
|
+
NativeBugReporting.setOnSDKDismissedHandler(handler);
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Sets the threshold value of the shake gesture for iPhone/iPod Touch
|
|
50
|
+
* Default for iPhone is 2.5.
|
|
51
|
+
* @param threshold Threshold for iPhone.
|
|
52
|
+
*/
|
|
53
|
+
export const setShakingThresholdForiPhone = (threshold) => {
|
|
54
|
+
if (Platform.OS === 'ios') {
|
|
55
|
+
NativeBugReporting.setShakingThresholdForiPhone(threshold);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Sets the threshold value of the shake gesture for iPad.
|
|
60
|
+
* Default for iPad is 0.6.
|
|
61
|
+
* @param threshold Threshold for iPad.
|
|
62
|
+
*/
|
|
63
|
+
export const setShakingThresholdForiPad = (threshold) => {
|
|
64
|
+
if (Platform.OS === 'ios') {
|
|
65
|
+
NativeBugReporting.setShakingThresholdForiPad(threshold);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Sets the threshold value of the shake gesture for android devices.
|
|
70
|
+
* Default for android is an integer value equals 350.
|
|
71
|
+
* you could increase the shaking difficulty level by
|
|
72
|
+
* increasing the `350` value and vice versa
|
|
73
|
+
* @param threshold Threshold for android devices.
|
|
74
|
+
*/
|
|
75
|
+
export const setShakingThresholdForAndroid = (threshold) => {
|
|
76
|
+
if (Platform.OS === 'android') {
|
|
77
|
+
NativeBugReporting.setShakingThresholdForAndroid(threshold);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Sets whether the extended bug report mode should be disabled, enabled with
|
|
82
|
+
* required fields or enabled with optional fields.
|
|
83
|
+
* @param mode An enum to disable the extended bug report mode,
|
|
84
|
+
* enable it with required or with optional fields.
|
|
85
|
+
*/
|
|
86
|
+
export const setExtendedBugReportMode = (mode) => {
|
|
87
|
+
NativeBugReporting.setExtendedBugReportMode(mode);
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Sets what type of reports, bug or feedback, should be invoked.
|
|
91
|
+
* @param types Array of reportTypes
|
|
92
|
+
*/
|
|
93
|
+
export const setReportTypes = (types) => {
|
|
94
|
+
NativeBugReporting.setReportTypes(types);
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Invoke bug reporting with report type and options.
|
|
98
|
+
* @param type
|
|
99
|
+
* @param options
|
|
100
|
+
*/
|
|
101
|
+
export const show = (type, options) => {
|
|
102
|
+
NativeBugReporting.show(type, options ?? []);
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Enable/Disable screen recording
|
|
106
|
+
* @param isEnabled enable/disable screen recording on crash feature
|
|
107
|
+
*/
|
|
108
|
+
export const setAutoScreenRecordingEnabled = (isEnabled) => {
|
|
109
|
+
NativeBugReporting.setAutoScreenRecordingEnabled(isEnabled);
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Sets auto screen recording maximum duration
|
|
113
|
+
*
|
|
114
|
+
* @param maxDuration maximum duration of the screen recording video in seconds.
|
|
115
|
+
* The maximum duration is 30 seconds
|
|
116
|
+
*/
|
|
117
|
+
export const setAutoScreenRecordingDurationIOS = (maxDuration) => {
|
|
118
|
+
if (Platform.OS !== 'ios') {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
NativeBugReporting.setAutoScreenRecordingDuration(maxDuration);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Sets the default position at which the Luciq screen recording button will be shown.
|
|
125
|
+
* Different orientations are already handled.
|
|
126
|
+
* (Default for `position` is `bottomRight`)
|
|
127
|
+
*
|
|
128
|
+
* @param buttonPosition is of type position `topLeft` to show on the top left
|
|
129
|
+
* of screen, or `bottomRight` to show on the bottom right of screen.
|
|
130
|
+
*/
|
|
131
|
+
export const setVideoRecordingFloatingButtonPosition = (buttonPosition) => {
|
|
132
|
+
NativeBugReporting.setVideoRecordingFloatingButtonPosition(buttonPosition);
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Enables/disables inspect view hierarchy when reporting a bug/feedback.
|
|
136
|
+
* @param isEnabled A boolean to set whether view hierarchy are enabled or disabled.
|
|
137
|
+
*/
|
|
138
|
+
export const setViewHierarchyEnabled = (isEnabled) => {
|
|
139
|
+
NativeBugReporting.setViewHierarchyEnabled(isEnabled);
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Adds a user consent item to the bug reporting form.
|
|
143
|
+
* @param key A unique identifier string for the consent item.
|
|
144
|
+
* @param description The text shown to the user describing the consent item.
|
|
145
|
+
* @param mandatory Whether the user must agree to this item before submitting a report.
|
|
146
|
+
* @param checked Whether the consent checkbox is pre-selected.
|
|
147
|
+
* @param actionType A string representing the action type to map to SDK behavior.
|
|
148
|
+
*/
|
|
149
|
+
export const addUserConsent = (key, description, mandatory, checked, actionType) => {
|
|
150
|
+
NativeBugReporting.addUserConsent(key, description, mandatory, checked, actionType);
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Sets a block of code to be executed when a prompt option is selected.
|
|
154
|
+
* @param handler - A callback that gets executed when a prompt option is selected.
|
|
155
|
+
*/
|
|
156
|
+
export const setDidSelectPromptOptionHandler = (handler) => {
|
|
157
|
+
if (Platform.OS === 'android') {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
emitter.addListener(NativeEvents.DID_SELECT_PROMPT_OPTION_HANDLER, (payload) => {
|
|
161
|
+
handler(payload.promptOption);
|
|
162
|
+
});
|
|
163
|
+
NativeBugReporting.setDidSelectPromptOptionHandler(handler);
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Sets the default edge and offset from the top at which the floating button
|
|
167
|
+
* will be shown. Different orientations are already handled.
|
|
168
|
+
* @param edge The screen edge to show the floating button onto. Default is `floatingButtonEdge.right`.
|
|
169
|
+
* @param offset The offset of the floating button from the top of the screen. Default is 50.
|
|
170
|
+
*/
|
|
171
|
+
export const setFloatingButtonEdge = (edge, offset) => {
|
|
172
|
+
NativeBugReporting.setFloatingButtonEdge(edge, offset);
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Sets whether attachments in bug reporting and in-app messaging are enabled or not.
|
|
176
|
+
* @param screenshot A boolean to enable or disable screenshot attachments.
|
|
177
|
+
* @param extraScreenshot A boolean to enable or disable extra screenshot attachments.
|
|
178
|
+
* @param galleryImage A boolean to enable or disable gallery image attachments. In iOS 10+,
|
|
179
|
+
* NSPhotoLibraryUsageDescription should be set in info.plist to enable gallery image attachments.
|
|
180
|
+
* @param screenRecording A boolean to enable or disable screen recording attachments.
|
|
181
|
+
*/
|
|
182
|
+
export const setEnabledAttachmentTypes = (screenshot, extraScreenshot, galleryImage, screenRecording) => {
|
|
183
|
+
NativeBugReporting.setEnabledAttachmentTypes(screenshot, extraScreenshot, galleryImage, screenRecording);
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Adds a disclaimer text within the bug reporting form, which can include hyperlinked text.
|
|
187
|
+
* @param text String text.
|
|
188
|
+
*/
|
|
189
|
+
export const setDisclaimerText = (text) => {
|
|
190
|
+
NativeBugReporting.setDisclaimerText(text);
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Sets a minimum number of characters as a requirement for the comments field in the different report types.
|
|
194
|
+
* @param limit int number of characters.
|
|
195
|
+
* @param reportTypes (Optional) Array of reportType. If it's not passed, the limit will apply to all report types.
|
|
196
|
+
* @platform iOS
|
|
197
|
+
*/
|
|
198
|
+
export const setCommentMinimumCharacterCount = (limit, reportTypes) => {
|
|
199
|
+
if (Platform.OS === 'ios') {
|
|
200
|
+
NativeBugReporting.setCommentMinimumCharacterCount(limit, reportTypes ?? []);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ExtendedError } from 'react-native/Libraries/Core/Devtools/parseErrorStack';
|
|
2
|
+
import type { NonFatalOptions } from '../models/NonFatalOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Enables and disables everything related to crash reporting including intercepting
|
|
5
|
+
* errors in the global error handler. It is enabled by default.
|
|
6
|
+
* @param isEnabled
|
|
7
|
+
*/
|
|
8
|
+
export declare const setEnabled: (isEnabled: boolean) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Send handled JS error object
|
|
11
|
+
* @param error Error object to be sent to Luciq's servers
|
|
12
|
+
* @param nonFatalOptions extra config for the non-fatal error sent with Error Object
|
|
13
|
+
*/
|
|
14
|
+
export declare const reportError: (error: ExtendedError, nonFatalOptions?: NonFatalOptions) => Promise<void> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Enables and disables capturing native C++ NDK crashes.
|
|
17
|
+
* @param isEnabled
|
|
18
|
+
*/
|
|
19
|
+
export declare const setNDKCrashesEnabled: (isEnabled: boolean) => void;
|