shakebug-react-native 2.4.6 → 2.4.7

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.6",
4
+ "version": "2.4.7",
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
  "types": "src/index.tsx",
@@ -1,5 +1,6 @@
1
1
  // NavigationContext.js
2
2
  import React, { createContext, useContext, useState } from 'react';
3
+ import { useFocusEffect } from '@react-navigation/native';
3
4
 
4
5
  const NavigationContext = createContext();
5
6
 
@@ -22,14 +23,16 @@ export const NavigationProvider = ({ children }) => {
22
23
  }
23
24
  };
24
25
 
25
- React.useEffect(() => {
26
- if (navigationState && navigationState.length > 0) {
27
- setFocusedScreen(navigationState[navigationState.length - 1].name);
28
- }
29
- return () => {
30
- setFocusedScreen('');
31
- };
32
- }, [navigationState]);
26
+ useFocusEffect(
27
+ React.useCallback(() => {
28
+ if (navigationState && navigationState.length > 0) {
29
+ setFocusedScreen(navigationState[navigationState.length - 1].name);
30
+ }
31
+ return () => {
32
+ setFocusedScreen('');
33
+ };
34
+ }, [navigationState])
35
+ );
33
36
 
34
37
  return (
35
38
  <NavigationContext.Provider value={{ navigationState, navigate, goBack, focusedScreen, goToScreenAtIndex}}>
@@ -492,7 +492,8 @@ const ShakeFunction = ({ children, themeColor, showTutorialScreen, SDKScreenTitl
492
492
  return (
493
493
  <View
494
494
  style={{
495
- flex: 1,
495
+ width: '100%',
496
+ height: '100%',
496
497
  }}
497
498
  >
498
499
 
@@ -6,6 +6,7 @@ import AddDetailsScreen from './AddDetailsScreen';
6
6
  import TrimVideoScreen from './TrimVideoScreen'
7
7
  import DeviceInfo from '../../DeviceInfo';
8
8
  import { useEffect, useState } from 'react';
9
+ import { useFocusEffect } from '@react-navigation/native';
9
10
  import GetLocation from '../../GetLocation'
10
11
  import NetInfo from '../../NetInfo/src'
11
12
  import { SessionStartApi } from '../APIs/StartSession';
@@ -52,7 +53,7 @@ global.isScreeenShotTaken = false;
52
53
  global.restrictedViews = [];
53
54
  global.currentScreen = ""
54
55
  global.isShakebugSDKOpen = false;
55
- global.sdk_version = "2.4.6";
56
+ global.sdk_version = "2.4.7";
56
57
  global.app_lunch_count = 0;
57
58
  global.POPUP_LAUNCH_THRESHOLD = 3;
58
59
  global.POPUP_COOLDOWN_DAYS = 2;
@@ -75,14 +76,16 @@ const NavigationContainer = ({ screens, setFocusedScreen }) => {
75
76
  const animation = React.useRef(new Animated.Value(0)).current;
76
77
  const { width } = Dimensions.get('window');
77
78
 
78
- React.useEffect(() => {
79
- if (navigationState && navigationState.length > 0) {
80
- setFocusedScreen(navigationState[navigationState.length - 1].name);
81
- }
82
- return () => {
83
- setFocusedScreen('');
84
- };
85
- }, [navigationState, setFocusedScreen]);
79
+ useFocusEffect(
80
+ React.useCallback(() => {
81
+ if (navigationState && navigationState.length > 0) {
82
+ setFocusedScreen(navigationState[navigationState.length - 1].name);
83
+ }
84
+ return () => {
85
+ setFocusedScreen('');
86
+ };
87
+ }, [navigationState, setFocusedScreen])
88
+ );
86
89
 
87
90
  React.useEffect(() => {
88
91
  Animated.timing(animation, {
@@ -538,7 +541,8 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
538
541
  }}>
539
542
  <View
540
543
  style={{
541
- flex: 1,
544
+ width: '100%',
545
+ height: '100%',
542
546
  }}
543
547
  >
544
548
  <GlobalStateProvider>
package/src/index.tsx CHANGED
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import Shakebug, { AddEvent } from '../src/Screens/Shakebug';
3
+ import { NavigationContainer, findFocusedRoute } from '@react-navigation/native';
3
4
  import { getLocales } from '../GetLocals/src';
4
5
  import { NativeModules, Text, View, findNodeHandle } from 'react-native';
5
6
  import { useGlobalState } from './Componanats/GlobalStateContext'
@@ -13,7 +14,7 @@ let LocalLanguage = LanguageCodes.indexOf(getLocales()[0].languageCode)
13
14
 
14
15
 
15
16
  // Define the props interface for ShakebugView
16
- export interface ShakebugViewProps {
17
+ interface ShakebugViewProps {
17
18
  children?: React.ReactNode;
18
19
  Android_appkey?: string;
19
20
  iOS_appkey?: string;
@@ -46,20 +47,22 @@ const ShakebugView: React.FC<ShakebugViewProps> = ({
46
47
  }) => {
47
48
 
48
49
  return (
49
- <Shakebug
50
- children={children}
51
- Android_appkey={Android_appkey}
52
- iOS_appkey={iOS_appkey}
53
- showTutorialScreenFirstTime={showTutorialScreenFirstTime}
54
- ShakebugThemeColor={ShakebugThemeColor}
55
- changeSDKScreenTitle={changeSDKScreenTitle}
56
- allowToReportBugByScreenCapture={allowToReportBugByScreenCapture}
57
- allowToReportBugByShakingMobile={allowToReportBugByShakingMobile}
58
- allowCrashReport={__DEV__ ? false : allowCrashReport}
59
- makeLogEnabled={makeLogEnabled}
60
- ShakebugLanguage={Languages.includes(ShakebugLanguage) ? ShakebugLanguage : LocalLanguage != -1 ? Languages[LocalLanguage] : "ENGLISH"}
61
- setShakebugSDKEndPointURL={setShakebugSDKEndPointURL}
62
- />
50
+ <NavigationContainer>
51
+ <Shakebug
52
+ children={children}
53
+ Android_appkey={Android_appkey}
54
+ iOS_appkey={iOS_appkey}
55
+ showTutorialScreenFirstTime={showTutorialScreenFirstTime}
56
+ ShakebugThemeColor={ShakebugThemeColor}
57
+ changeSDKScreenTitle={changeSDKScreenTitle}
58
+ allowToReportBugByScreenCapture={allowToReportBugByScreenCapture}
59
+ allowToReportBugByShakingMobile={allowToReportBugByShakingMobile}
60
+ allowCrashReport={__DEV__ ? false : allowCrashReport}
61
+ makeLogEnabled={makeLogEnabled}
62
+ ShakebugLanguage={Languages.includes(ShakebugLanguage) ? ShakebugLanguage : LocalLanguage != -1 ? Languages[LocalLanguage] : "ENGLISH"}
63
+ setShakebugSDKEndPointURL={setShakebugSDKEndPointURL}
64
+ />
65
+ </NavigationContainer>
63
66
  );
64
67
  };
65
68