shakebug-react-native 2.4.1 → 2.4.3
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shakebug-react-native",
|
|
3
3
|
"title": "shakebug-react-native",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
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": {
|
|
@@ -23,16 +23,14 @@ export const NavigationProvider = ({ children }) => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [navigationState])
|
|
35
|
-
);
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
if (navigationState && navigationState.length > 0) {
|
|
28
|
+
setFocusedScreen(navigationState[navigationState.length - 1].name);
|
|
29
|
+
}
|
|
30
|
+
return () => {
|
|
31
|
+
setFocusedScreen('');
|
|
32
|
+
};
|
|
33
|
+
}, [navigationState]);
|
|
36
34
|
|
|
37
35
|
return (
|
|
38
36
|
<NavigationContext.Provider value={{ navigationState, navigate, goBack, focusedScreen, goToScreenAtIndex}}>
|
|
@@ -301,9 +301,10 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
301
301
|
}, 200)
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
if (Platform.OS == 'android' && global.isRecording == false && global.isTrigger == false && isBugReportingEnabled()) {
|
|
304
|
+
if (Platform.OS == 'android' && global.isRecording == false && global.isTrigger == false && isBugReportingEnabled() && !global.isShakebugSDKOpen) {
|
|
305
305
|
if (calculate.toFixed(2) >= 18) {
|
|
306
306
|
if (global.isAndroidValid == true && global.application_id != "" && global.application_id != undefined && global.isTrigger == false) {
|
|
307
|
+
global.isShakebugSDKOpen = true; // Lock immediately to prevent double navigation
|
|
307
308
|
setIsScreenShot(true)
|
|
308
309
|
let ImgUrl = null;
|
|
309
310
|
try {
|
|
@@ -315,10 +316,10 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
315
316
|
if (ImgUrl != undefined || ImgUrl != null) {
|
|
316
317
|
subscription.unsubscribe();
|
|
317
318
|
global.IsBackground = false
|
|
318
|
-
global.isShakebugSDKOpen = true
|
|
319
319
|
navigate("FirstScreen", { img: `${ImgUrl}`, themeColor: `${themeColor}`, SDKScreenTitle: `${SDKScreenTitle}` })
|
|
320
320
|
}
|
|
321
321
|
else {
|
|
322
|
+
global.isShakebugSDKOpen = false;
|
|
322
323
|
setIsScreenShot(false)
|
|
323
324
|
}
|
|
324
325
|
}
|
|
@@ -328,9 +329,10 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
328
329
|
}
|
|
329
330
|
}
|
|
330
331
|
}
|
|
331
|
-
else if (Platform.OS == 'ios' && global.isRecording == false && global.isTrigger == false && isBugReportingEnabled()) {
|
|
332
|
+
else if (Platform.OS == 'ios' && global.isRecording == false && global.isTrigger == false && isBugReportingEnabled() && !global.isShakebugSDKOpen) {
|
|
332
333
|
if (calculate.toFixed(2) >= 2.00) {
|
|
333
334
|
if (global.isIOSValid == true && global.application_id != "" && global.application_id != undefined) {
|
|
335
|
+
global.isShakebugSDKOpen = true; // Lock immediately to prevent double navigation
|
|
334
336
|
setIsScreenShot(true)
|
|
335
337
|
|
|
336
338
|
let ImgUrl = null;
|
|
@@ -348,10 +350,10 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
|
|
|
348
350
|
}
|
|
349
351
|
if (ImgUrl != undefined || ImgUrl != null) {
|
|
350
352
|
subscription.unsubscribe();
|
|
351
|
-
global.isShakebugSDKOpen = true
|
|
352
353
|
navigate("FirstScreen", { img: `${ImgUrl}`, themeColor: `${themeColor}`, SDKScreenTitle: `${SDKScreenTitle}` })
|
|
353
354
|
}
|
|
354
355
|
else {
|
|
356
|
+
global.isShakebugSDKOpen = false;
|
|
355
357
|
setIsScreenShot(false)
|
|
356
358
|
}
|
|
357
359
|
|
|
@@ -285,11 +285,11 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
return (
|
|
288
|
-
<SafeAreaView style={{ width:
|
|
288
|
+
<SafeAreaView style={{ flex: 1, width: Dimensions.get('window').width, height: Dimensions.get('window').height, backgroundColor: themeColor, paddingTop: Platform.OS == 'android' && DeviceInfo?.getSystemVersion() > 14 ? StatusBar.currentHeight : 0 , paddingBottom: Platform.OS == 'android' && DeviceInfo?.getSystemVersion() > 14 ? StatusBar.currentHeight : 0}}>
|
|
289
289
|
<StatusBar backgroundColor={ThemeColor} hidden={false} />
|
|
290
290
|
<KeyboardAvoidingWrapper>
|
|
291
291
|
<>
|
|
292
|
-
<View style={{ width:
|
|
292
|
+
<View style={{ flex: 1, width: '100%', height: '100%', backgroundColor: "#ffffff" }}>
|
|
293
293
|
<View style={{ height: '6%', padding: 5, paddingHorizontal: 15, backgroundColor: ThemeColor, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
294
294
|
<TouchableOpacity
|
|
295
295
|
style={{
|
|
@@ -309,10 +309,10 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
|
|
|
309
309
|
// backgroundColor: "#181818"
|
|
310
310
|
|
|
311
311
|
return (
|
|
312
|
-
<SafeAreaView style={{ width:
|
|
312
|
+
<SafeAreaView style={{ flex: 1, width: Dimensions.get('window').width, height: Dimensions.get('window').height, backgroundColor: themeColor, paddingTop: Platform.OS == 'android' && DeviceInfo?.getSystemVersion() > 14 ? StatusBar.currentHeight : 0 , paddingBottom: Platform.OS == 'android' && DeviceInfo?.getSystemVersion() > 14 ? StatusBar.currentHeight : 0}}>
|
|
313
313
|
<StatusBar backgroundColor={ThemeColor} />
|
|
314
314
|
|
|
315
|
-
<View style={{ width:
|
|
315
|
+
<View style={{ flex: 1, width: '100%', height: '100%', backgroundColor: "#e4fdfd" }}>
|
|
316
316
|
<View style={{ height: '6%', padding: 5, paddingHorizontal: 15, backgroundColor: ThemeColor, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
317
317
|
<TouchableOpacity
|
|
318
318
|
style={{
|
package/src/Screens/Shakebug.js
CHANGED
|
@@ -53,7 +53,7 @@ global.isScreeenShotTaken = false;
|
|
|
53
53
|
global.restrictedViews = [];
|
|
54
54
|
global.currentScreen = ""
|
|
55
55
|
global.isShakebugSDKOpen = false;
|
|
56
|
-
global.sdk_version = "2.4.
|
|
56
|
+
global.sdk_version = "2.4.3";
|
|
57
57
|
global.app_lunch_count = 0;
|
|
58
58
|
global.POPUP_LAUNCH_THRESHOLD = 3;
|
|
59
59
|
global.POPUP_COOLDOWN_DAYS = 2;
|
|
@@ -76,16 +76,14 @@ const NavigationContainer = ({ screens, setFocusedScreen }) => {
|
|
|
76
76
|
const animation = React.useRef(new Animated.Value(0)).current;
|
|
77
77
|
const { width } = Dimensions.get('window');
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, [navigationState, setFocusedScreen])
|
|
88
|
-
);
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
if (navigationState && navigationState.length > 0) {
|
|
81
|
+
setFocusedScreen(navigationState[navigationState.length - 1].name);
|
|
82
|
+
}
|
|
83
|
+
return () => {
|
|
84
|
+
setFocusedScreen('');
|
|
85
|
+
};
|
|
86
|
+
}, [navigationState, setFocusedScreen]);
|
|
89
87
|
|
|
90
88
|
React.useEffect(() => {
|
|
91
89
|
Animated.timing(animation, {
|
|
@@ -468,7 +466,7 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
468
466
|
setAllowCrashFlag(global.allowCrashReport);
|
|
469
467
|
setAllowEventFlag(global.allowEvent);
|
|
470
468
|
setAllowReviewFlag(global.allowReview);
|
|
471
|
-
setAllowSessionFlag(global.allowSession);
|
|
469
|
+
setAllowSessionFlag(global.allowSession); log.debug("------------------------------------------------------------------------------------------");
|
|
472
470
|
log.info('API response:', message);
|
|
473
471
|
log.debug("------------------------------------------------------------------------------------------");
|
|
474
472
|
if (global.allowSession) { StartSession(); }
|
|
@@ -542,6 +540,8 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
542
540
|
<View
|
|
543
541
|
style={{
|
|
544
542
|
flex: 1,
|
|
543
|
+
width: '100%',
|
|
544
|
+
height: '100%'
|
|
545
545
|
}}
|
|
546
546
|
>
|
|
547
547
|
<GlobalStateProvider>
|
|
@@ -638,9 +638,18 @@ export const AddEvent = async (name, value) => {
|
|
|
638
638
|
const styles = StyleSheet.create({
|
|
639
639
|
container: {
|
|
640
640
|
flex: 1,
|
|
641
|
+
width: Dimensions.get('window').width,
|
|
642
|
+
height: Dimensions.get('window').height,
|
|
641
643
|
position: 'relative',
|
|
642
644
|
},
|
|
643
645
|
screen: {
|
|
644
|
-
|
|
646
|
+
flex: 1,
|
|
647
|
+
width: Dimensions.get('window').width,
|
|
648
|
+
height: Dimensions.get('window').height,
|
|
649
|
+
position: 'absolute',
|
|
650
|
+
top: 0,
|
|
651
|
+
bottom: 0,
|
|
652
|
+
left: 0,
|
|
653
|
+
right: 0,
|
|
645
654
|
},
|
|
646
655
|
});
|
|
@@ -8,7 +8,7 @@ const TutorialScreen = () => {
|
|
|
8
8
|
const { goBack } = useNavigation();
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<SafeAreaView style={{ width: '100%', height: '100%', backgroundColor: '#FFF', alignItems: 'center', justifyContent: 'center' }}>
|
|
11
|
+
<SafeAreaView style={{ flex: 1, width: '100%', height: '100%', backgroundColor: '#FFF', alignItems: 'center', justifyContent: 'center' }}>
|
|
12
12
|
<StatusBar
|
|
13
13
|
backgroundColor='#fff'
|
|
14
14
|
barStyle={'dark-content'}
|