shakebug-react-native 2.3.7 → 2.3.9
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/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/package.json +1 -1
- package/src/APIs/MatchKey.js +1 -1
- package/src/Componanats/CustomAlert.js +24 -99
- package/src/Componanats/ReviewModal.js +1 -1
- package/src/Componanats/ShakeFunction.js +23 -32
- package/src/Screens/AddDetailsScreen.js +5 -7
- package/src/Screens/FirstScreen.js +3 -3
- package/src/Screens/Shakebug.js +84 -13
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shakebug-react-native",
|
|
3
3
|
"title": "shakebug-react-native",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.9",
|
|
5
5
|
"description": "Shakebug allows users to report the bug from your mobile phone for your application. Here users just need to shake their mobile and all the data regarding bugs & crashes can be seen by developers through their log in panel easily",
|
|
6
6
|
"main": "src/index.tsx",
|
|
7
7
|
"scripts": {
|
package/src/APIs/MatchKey.js
CHANGED
|
@@ -27,7 +27,7 @@ async function MatchKeyApi(appkey, BundleId) {
|
|
|
27
27
|
const total_video = data.response_data.total_video;
|
|
28
28
|
const used_video = data.response_data.used_video;
|
|
29
29
|
const video_duration = data.response_data.video_duration;
|
|
30
|
-
return { success: true, application_id, total_mau, used_mau, total_video, used_video, video_duration, message: data.msg };
|
|
30
|
+
return { success: true, application_id, total_mau, used_mau, total_video, used_video, video_duration, shakebug_type: data.response_data.shakebug_type, message: data.msg };
|
|
31
31
|
} else {
|
|
32
32
|
return { success: false, message: data.msg };
|
|
33
33
|
}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { View, Text, Button, StyleSheet, Modal, TouchableOpacity
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, Button, StyleSheet, Modal, TouchableOpacity } from 'react-native';
|
|
3
3
|
|
|
4
|
-
const CustomeAlert = ({color, isVisible, OnPrees, text
|
|
4
|
+
const CustomeAlert = ({color, isVisible, OnPrees, text}) => {
|
|
5
5
|
|
|
6
|
-
const [copied, setCopied] = useState(false);
|
|
7
|
-
|
|
8
|
-
const handleCopy = () => {
|
|
9
|
-
Clipboard.setString(text);
|
|
10
|
-
setCopied(true);
|
|
11
|
-
setTimeout(() => setCopied(false), 2000);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const handleClose = () => {
|
|
15
|
-
setCopied(false);
|
|
16
|
-
OnPrees();
|
|
17
|
-
};
|
|
18
|
-
|
|
19
6
|
return (
|
|
20
7
|
<Modal
|
|
21
8
|
transparent={true}
|
|
@@ -30,58 +17,30 @@ const CustomeAlert = ({color, isVisible, OnPrees, text, showCopyOption}) => {
|
|
|
30
17
|
height: text.length > 120 ? 300 : text.length < 50 ? 170 : 200
|
|
31
18
|
}]}
|
|
32
19
|
>
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{showCopyOption ? (
|
|
50
|
-
<View style={styles.buttonRow}>
|
|
51
|
-
<TouchableOpacity
|
|
52
|
-
style={[styles.button, { backgroundColor: '#6c757d', marginRight: 10 }]}
|
|
53
|
-
onPress={handleCopy}
|
|
54
|
-
>
|
|
55
|
-
<Text style={styles.buttonText}>
|
|
56
|
-
{copied ? '✓ Copied' : '📋 Copy'}
|
|
57
|
-
</Text>
|
|
58
|
-
</TouchableOpacity>
|
|
59
|
-
<TouchableOpacity
|
|
60
|
-
style={[styles.button, { backgroundColor: color }]}
|
|
61
|
-
onPress={handleClose}
|
|
62
|
-
>
|
|
63
|
-
<Text style={styles.buttonText}>
|
|
64
|
-
Okay
|
|
65
|
-
</Text>
|
|
66
|
-
</TouchableOpacity>
|
|
67
|
-
</View>
|
|
68
|
-
) : (
|
|
69
|
-
<TouchableOpacity
|
|
20
|
+
<Text style={styles.text}>
|
|
21
|
+
{text}
|
|
22
|
+
</Text>
|
|
23
|
+
|
|
24
|
+
<TouchableOpacity
|
|
25
|
+
style={{
|
|
26
|
+
width: '100%',
|
|
27
|
+
backgroundColor: color,
|
|
28
|
+
height: 40,
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
borderRadius: 8
|
|
32
|
+
}}
|
|
33
|
+
onPress={OnPrees}
|
|
34
|
+
>
|
|
35
|
+
<Text
|
|
70
36
|
style={{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
height: 40,
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
justifyContent: 'center',
|
|
76
|
-
borderRadius: 8
|
|
37
|
+
fontSize: 16,
|
|
38
|
+
color: "#fff"
|
|
77
39
|
}}
|
|
78
|
-
onPress={handleClose}
|
|
79
40
|
>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</TouchableOpacity>
|
|
84
|
-
)}
|
|
41
|
+
Okay
|
|
42
|
+
</Text>
|
|
43
|
+
</TouchableOpacity>
|
|
85
44
|
</View>
|
|
86
45
|
</View>
|
|
87
46
|
</Modal>
|
|
@@ -116,40 +75,6 @@ const styles = StyleSheet.create({
|
|
|
116
75
|
textAlign: 'center',
|
|
117
76
|
color: "#000"
|
|
118
77
|
},
|
|
119
|
-
scrollContainer: {
|
|
120
|
-
maxHeight: 140,
|
|
121
|
-
width: '100%',
|
|
122
|
-
backgroundColor: '#f8f9fa',
|
|
123
|
-
borderRadius: 8,
|
|
124
|
-
borderWidth: 1,
|
|
125
|
-
borderColor: '#dee2e6',
|
|
126
|
-
},
|
|
127
|
-
scrollContent: {
|
|
128
|
-
padding: 12,
|
|
129
|
-
},
|
|
130
|
-
errorText: {
|
|
131
|
-
fontSize: 13,
|
|
132
|
-
color: '#dc3545',
|
|
133
|
-
lineHeight: 18,
|
|
134
|
-
fontFamily: Platform.OS === 'ios' ? 'Menlo' : 'monospace',
|
|
135
|
-
},
|
|
136
|
-
buttonRow: {
|
|
137
|
-
flexDirection: 'row',
|
|
138
|
-
width: '100%',
|
|
139
|
-
justifyContent: 'center',
|
|
140
|
-
marginTop: 10,
|
|
141
|
-
},
|
|
142
|
-
button: {
|
|
143
|
-
flex: 1,
|
|
144
|
-
height: 40,
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
justifyContent: 'center',
|
|
147
|
-
borderRadius: 8,
|
|
148
|
-
},
|
|
149
|
-
buttonText: {
|
|
150
|
-
fontSize: 16,
|
|
151
|
-
color: '#fff',
|
|
152
|
-
},
|
|
153
78
|
});
|
|
154
79
|
|
|
155
80
|
export default CustomeAlert;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { Modal, View, Text, TextInput, TouchableOpacity, StyleSheet, Image, KeyboardAvoidingView, ScrollView, TouchableWithoutFeedback, Keyboard, NativeModules } from 'react-native';
|
|
3
|
-
import { AddReviewApi } from '
|
|
3
|
+
import { AddReviewApi } from '../APIs/AddReview';
|
|
4
4
|
|
|
5
5
|
const ReviewModal = ({ visible, onClose, onSubmit, color }) => {
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ console.ignoredYellowBox = ["Warning: Each", "Warning: Failed", "Possible", "WAR
|
|
|
12
12
|
|
|
13
13
|
import { logger, consoleTransport } from "react-native-logs";
|
|
14
14
|
import { ActivityIndicator } from 'react-native';
|
|
15
|
-
import { useGlobalState } from '
|
|
15
|
+
import { useGlobalState } from './GlobalStateContext';
|
|
16
16
|
|
|
17
17
|
LogBox.ignoreAllLogs()
|
|
18
18
|
|
|
@@ -490,27 +490,26 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
490
490
|
>
|
|
491
491
|
|
|
492
492
|
<ShakebugCapture ref={ref} options={{ format: "jpg", quality: 1, }} style={{ flex: 1 }}>
|
|
493
|
-
{
|
|
494
|
-
|
|
495
|
-
|
|
493
|
+
<View style={{ flex: 1 }}>
|
|
494
|
+
{children}
|
|
495
|
+
</View>
|
|
496
|
+
{isDraw && (
|
|
497
|
+
<RNDrawingView
|
|
498
|
+
ref={canvasRef}
|
|
496
499
|
style={{
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
+
position: 'absolute',
|
|
501
|
+
top: 0,
|
|
502
|
+
left: 0,
|
|
503
|
+
right: 0,
|
|
504
|
+
bottom: 0,
|
|
505
|
+
width: '100%',
|
|
506
|
+
height: '100%',
|
|
507
|
+
zIndex: 999
|
|
500
508
|
}}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
style={{ width: '100%', height: '100%' }}
|
|
506
|
-
color={'red'}
|
|
507
|
-
strokeWidth={Platform.OS == 'android' ? 5 : 3}
|
|
508
|
-
/>
|
|
509
|
-
|
|
510
|
-
</ImageBackground>
|
|
511
|
-
) : (<View style={{ flex: 1 }}>
|
|
512
|
-
{children}
|
|
513
|
-
</View>)}
|
|
509
|
+
color={'red'}
|
|
510
|
+
strokeWidth={Platform.OS == 'android' ? 5 : 3}
|
|
511
|
+
/>
|
|
512
|
+
)}
|
|
514
513
|
|
|
515
514
|
|
|
516
515
|
</ShakebugCapture>
|
|
@@ -555,18 +554,9 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
555
554
|
|
|
556
555
|
{isDraw == false ? (
|
|
557
556
|
<TouchableOpacity
|
|
558
|
-
onPress={
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
try {
|
|
562
|
-
ImgUrl = Platform.OS === 'android' ? await captureScreen({ format: 'jpg', quality: 1 }) : (ref.current ? await ref.current.capture() : null);
|
|
563
|
-
} catch (e) {
|
|
564
|
-
log.error("Failed to capture screenshot in stop recording", e);
|
|
565
|
-
}
|
|
566
|
-
if (ImgUrl != undefined || ImgUrl != null) {
|
|
567
|
-
setImg(ImgUrl)
|
|
568
|
-
setIsDraw(true)
|
|
569
|
-
}
|
|
557
|
+
onPress={() => {
|
|
558
|
+
setIsDraw(true)
|
|
559
|
+
global.isDraw = true
|
|
570
560
|
}}
|
|
571
561
|
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
572
562
|
>
|
|
@@ -576,6 +566,7 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
576
566
|
<TouchableOpacity
|
|
577
567
|
onPress={() => {
|
|
578
568
|
setIsDraw(false)
|
|
569
|
+
global.isDraw = false
|
|
579
570
|
ClearCanvas(canvasRef)
|
|
580
571
|
}}
|
|
581
572
|
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
@@ -10,9 +10,9 @@ import { ActivityIndicator } from 'react-native';
|
|
|
10
10
|
import { UIManager } from 'react-native';
|
|
11
11
|
import { ScrollView } from 'react-native';
|
|
12
12
|
import KeyboardAvoidingWrapper from '../Componanats/KeyboardAvoidingWrapper';
|
|
13
|
-
import { useGlobalState } from '
|
|
14
|
-
import CustomeAlert from '
|
|
15
|
-
import NetInfo from '
|
|
13
|
+
import { useGlobalState } from '../Componanats/GlobalStateContext';
|
|
14
|
+
import CustomeAlert from '../Componanats/CustomAlert';
|
|
15
|
+
import NetInfo from '../../NetInfo/src';
|
|
16
16
|
import DeviceInfo from '../../DeviceInfo';
|
|
17
17
|
|
|
18
18
|
console.ignoredYellowBox = ["Warning: Each", "Warning: Failed", "Non-serializable"];
|
|
@@ -254,7 +254,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
254
254
|
log.debug("------------------------------------------------------------------------------------------")
|
|
255
255
|
} else {
|
|
256
256
|
setIsLoading(false)
|
|
257
|
-
setAPIMessage(
|
|
257
|
+
setAPIMessage("Something went wrong! Please try again later!")
|
|
258
258
|
setErrorInAPI(true)
|
|
259
259
|
log.debug("------------------------------------------------------------------------------------------")
|
|
260
260
|
log.warn('API response:', message);
|
|
@@ -262,8 +262,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
catch (err) {
|
|
265
|
-
|
|
266
|
-
setAPIMessage(errorMsg)
|
|
265
|
+
setAPIMessage("Something went wrong! Please try again later!")
|
|
267
266
|
setErrorInAPI(true)
|
|
268
267
|
setIsLoading(false)
|
|
269
268
|
log.error("err", err)
|
|
@@ -433,7 +432,6 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
433
432
|
isVisible={isErrorInAPI || isBugReported}
|
|
434
433
|
text={apiMessage}
|
|
435
434
|
color={themeColor}
|
|
436
|
-
showCopyOption={isErrorInAPI}
|
|
437
435
|
OnPrees={() => {
|
|
438
436
|
if (isBugReported) {
|
|
439
437
|
global.isScreenShotDetected = false;
|
|
@@ -5,12 +5,12 @@ import { ShakebugCapture, captureScreen } from '../index';
|
|
|
5
5
|
import { launchImageLibrary } from '../../ImageOrVedioPicker/src/index';
|
|
6
6
|
import { logger, consoleTransport } from "react-native-logs";
|
|
7
7
|
import { NativeModules } from 'react-native';
|
|
8
|
-
import { useNavigation } from '
|
|
9
|
-
import { Localization } from '
|
|
8
|
+
import { useNavigation } from '../Componanats/NavigationContext';
|
|
9
|
+
import { Localization } from '../Componanats/localization';
|
|
10
10
|
import { ActivityIndicator } from 'react-native';
|
|
11
11
|
import DeviceInfo from '../../DeviceInfo';
|
|
12
12
|
import { useGlobalState } from '../Componanats/GlobalStateContext.js';
|
|
13
|
-
import CustomeAlert from '
|
|
13
|
+
import CustomeAlert from '../Componanats/CustomAlert.js';
|
|
14
14
|
|
|
15
15
|
console.disableYellowBox = true;
|
|
16
16
|
console.ignoredYellowBox = ["Warning: Each", "Warning: Failed", "Possible"];
|
package/src/Screens/Shakebug.js
CHANGED
|
@@ -19,8 +19,8 @@ import { setGlobalErrorHandler } from '../Componanats/ErrorHandler';
|
|
|
19
19
|
import { NavigationProvider, useNavigation } from '../Componanats/NavigationContext';
|
|
20
20
|
import { Localization } from '../Componanats/localization';
|
|
21
21
|
import { GlobalStateProvider, useGlobalState } from '../Componanats/GlobalStateContext';
|
|
22
|
-
import CustomeAlert from '
|
|
23
|
-
import ReviewModal from '
|
|
22
|
+
import CustomeAlert from '../Componanats/CustomAlert';
|
|
23
|
+
import ReviewModal from '../Componanats/ReviewModal';
|
|
24
24
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
25
25
|
|
|
26
26
|
console.ignoredYellowBox = ["Warning: Each", "Warning: Failed"];
|
|
@@ -53,11 +53,19 @@ global.isScreeenShotTaken = false;
|
|
|
53
53
|
global.restrictedViews = [];
|
|
54
54
|
global.currentScreen = ""
|
|
55
55
|
global.isShakebugSDKOpen = false;
|
|
56
|
-
global.sdk_version = "2.3.
|
|
56
|
+
global.sdk_version = "2.3.9";
|
|
57
57
|
global.app_lunch_count = 0;
|
|
58
58
|
global.POPUP_LAUNCH_THRESHOLD = 3;
|
|
59
59
|
global.POPUP_COOLDOWN_DAYS = 2;
|
|
60
60
|
global.KEY_REVIEW_SUBMITTED = false;
|
|
61
|
+
// Initialize feature flags with defaults (allow all)
|
|
62
|
+
global.allowBugReport = true;
|
|
63
|
+
global.allowCrashReport = true;
|
|
64
|
+
global.allowEvent = true;
|
|
65
|
+
global.allowReview = true;
|
|
66
|
+
global.allowSession = true;
|
|
67
|
+
global.shakebug_type = "1"; // default allow all
|
|
68
|
+
|
|
61
69
|
|
|
62
70
|
const ShakebugContext = React.createContext();
|
|
63
71
|
|
|
@@ -147,6 +155,12 @@ const ShakeScreen = () => {
|
|
|
147
155
|
|
|
148
156
|
function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirstTime, ShakebugThemeColor, changeSDKScreenTitle, allowToReportBugByShakingMobile, allowToReportBugByScreenCapture, allowCrashReport, ShakebugLanguage, makeLogEnabled, setShakebugSDKEndPointURL }) {
|
|
149
157
|
|
|
158
|
+
const [allowBugReport, setAllowBugReport] = useState(true);
|
|
159
|
+
const [allowCrashFlag, setAllowCrashFlag] = useState(true);
|
|
160
|
+
const [allowEventFlag, setAllowEventFlag] = useState(true);
|
|
161
|
+
const [allowReviewFlag, setAllowReviewFlag] = useState(true);
|
|
162
|
+
const [allowSessionFlag, setAllowSessionFlag] = useState(true);
|
|
163
|
+
|
|
150
164
|
const { ShakebugSDKSharedPreferencesModule } = NativeModules;
|
|
151
165
|
|
|
152
166
|
const ThemeColor = ShakebugThemeColor ? ShakebugThemeColor : "#1dd3e3";
|
|
@@ -237,7 +251,7 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
237
251
|
|
|
238
252
|
global.app_lunch_count = (parseInt(KEY_APP_LAUNCH_COUNT) + 1);
|
|
239
253
|
|
|
240
|
-
if (global.app_lunch_count >= POPUP_LAUNCH_THRESHOLD) {
|
|
254
|
+
if (global.app_lunch_count >= POPUP_LAUNCH_THRESHOLD && global.allowReview) {
|
|
241
255
|
if (LAST_POPUP_TIME && LAST_POPUP_TIME != "" && IS_REVIEW_SUBMITTED != "true") {
|
|
242
256
|
const now = Date.now(); // current timestamp in milliseconds
|
|
243
257
|
const sevenDaysInMs = global.POPUP_COOLDOWN_DAYS * 24 * 60 * 60 * 1000; // 7 days in milliseconds
|
|
@@ -365,7 +379,7 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
365
379
|
try {
|
|
366
380
|
let BundleId = DeviceInfo.getBundleId();
|
|
367
381
|
|
|
368
|
-
const { success, application_id: newApplication_id, message, total_mau, used_mau, total_video, used_video, video_duration } = await MatchKeyApi(appkey, BundleId);
|
|
382
|
+
const { success, application_id: newApplication_id, message, total_mau, used_mau, total_video, used_video, video_duration, shakebug_type } = await MatchKeyApi(appkey, BundleId);
|
|
369
383
|
|
|
370
384
|
global.videoDuration = video_duration;
|
|
371
385
|
|
|
@@ -395,11 +409,64 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
395
409
|
else {
|
|
396
410
|
global.isIOSValid = true
|
|
397
411
|
}
|
|
398
|
-
global.application_id = newApplication_id
|
|
399
|
-
|
|
412
|
+
global.application_id = newApplication_id;
|
|
413
|
+
// Set feature flags based on shakebug_type (supports comma‑separated codes)
|
|
414
|
+
// Reset all flags to false initially
|
|
415
|
+
global.allowBugReport = false;
|
|
416
|
+
global.allowCrashReport = false;
|
|
417
|
+
global.allowEvent = false;
|
|
418
|
+
global.allowReview = false;
|
|
419
|
+
global.allowSession = false;
|
|
420
|
+
// Helper to enable a specific flag
|
|
421
|
+
const enableFlag = (code) => {
|
|
422
|
+
switch (code) {
|
|
423
|
+
case "0":
|
|
424
|
+
// Disable all – already false
|
|
425
|
+
break;
|
|
426
|
+
case "1":
|
|
427
|
+
// Enable all
|
|
428
|
+
global.allowBugReport = true;
|
|
429
|
+
global.allowCrashReport = true;
|
|
430
|
+
global.allowEvent = true;
|
|
431
|
+
global.allowReview = true;
|
|
432
|
+
global.allowSession = true;
|
|
433
|
+
break;
|
|
434
|
+
case "2":
|
|
435
|
+
global.allowBugReport = true;
|
|
436
|
+
break;
|
|
437
|
+
case "3":
|
|
438
|
+
global.allowCrashReport = true;
|
|
439
|
+
break;
|
|
440
|
+
case "4":
|
|
441
|
+
global.allowEvent = true;
|
|
442
|
+
break;
|
|
443
|
+
case "5":
|
|
444
|
+
global.allowReview = true;
|
|
445
|
+
break;
|
|
446
|
+
case "6":
|
|
447
|
+
global.allowSession = true;
|
|
448
|
+
break;
|
|
449
|
+
default:
|
|
450
|
+
// ignore unknown codes
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
// Split the incoming string and enable flags for each code
|
|
455
|
+
if (shakebug_type) {
|
|
456
|
+
const codes = String(shakebug_type).split(',').map(c => c.trim());
|
|
457
|
+
codes.forEach(enableFlag);
|
|
458
|
+
}
|
|
459
|
+
// Store raw type for reference
|
|
460
|
+
global.shakebug_type = shakebug_type;
|
|
461
|
+
// Update React state so UI re‑renders with new flags
|
|
462
|
+
setAllowBugReport(global.allowBugReport);
|
|
463
|
+
setAllowCrashFlag(global.allowCrashReport);
|
|
464
|
+
setAllowEventFlag(global.allowEvent);
|
|
465
|
+
setAllowReviewFlag(global.allowReview);
|
|
466
|
+
setAllowSessionFlag(global.allowSession); log.debug("------------------------------------------------------------------------------------------");
|
|
400
467
|
log.info('API response:', message);
|
|
401
|
-
log.debug("------------------------------------------------------------------------------------------")
|
|
402
|
-
StartSession()
|
|
468
|
+
log.debug("------------------------------------------------------------------------------------------");
|
|
469
|
+
if (global.allowSession) { StartSession(); }
|
|
403
470
|
} else {
|
|
404
471
|
if (Platform.OS == "android") {
|
|
405
472
|
global.isAndroidValid = false
|
|
@@ -461,9 +528,9 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
461
528
|
showTutorialScreenFirstTime,
|
|
462
529
|
FirstScreenTitle,
|
|
463
530
|
SecondScreenTitle,
|
|
464
|
-
allowToReportBugByShakingMobile,
|
|
465
|
-
allowToReportBugByScreenCapture,
|
|
466
|
-
allowCrashReport,
|
|
531
|
+
allowToReportBugByShaking: allowToReportBugByShakingMobile && allowBugReport,
|
|
532
|
+
allowToReportBugByScreenCapture: allowToReportBugByScreenCapture && allowBugReport,
|
|
533
|
+
allowCrashReport: allowCrashReport && allowCrashFlag,
|
|
467
534
|
ShakebugLanguage
|
|
468
535
|
}}>
|
|
469
536
|
<View
|
|
@@ -534,6 +601,10 @@ export const AddEvent = async (name, value) => {
|
|
|
534
601
|
|
|
535
602
|
var log = logger.createLogger(defaultConfig);
|
|
536
603
|
|
|
604
|
+
if (!global.allowEvent) {
|
|
605
|
+
log.warn("Event reporting is disabled by shakebug_type");
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
537
608
|
|
|
538
609
|
if (global.application_id != "") {
|
|
539
610
|
try {
|
|
@@ -566,4 +637,4 @@ const styles = StyleSheet.create({
|
|
|
566
637
|
screen: {
|
|
567
638
|
...StyleSheet.absoluteFillObject,
|
|
568
639
|
},
|
|
569
|
-
});
|
|
640
|
+
});
|