shakebug-react-native 2.4.5 → 2.4.6

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/README.md CHANGED
@@ -94,27 +94,7 @@ export default App = () => {
94
94
  }
95
95
  ```
96
96
 
97
- If you use NavigationContainer in App.js/root file (where you import ShakebugView) then you need to pass independent as parameter in NavigationContainer
98
97
 
99
- ```javascript
100
-
101
- Import ShakebugView from 'shakebug-react-native';
102
-
103
- export default App = () => {
104
- return(
105
- <ShakebugView
106
- Android_appkey= “your android app key”
107
- iOS_appkey= “your ios app key”
108
- other options…
109
- >
110
- <NavigationContainer independent>
111
- //Your code...
112
- </NavigationContainer>
113
- </ShakebugView>
114
- )
115
- }
116
-
117
- ```
118
98
  You can add event on click:
119
99
 
120
100
  ```javascript
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "shakebug-react-native",
3
3
  "title": "shakebug-react-native",
4
- "version": "2.4.5",
4
+ "version": "2.4.6",
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
+ "types": "src/index.tsx",
7
8
  "scripts": {
8
9
  "test": "echo \"Error: no test specified\" && exit 1"
9
10
  },
@@ -1,6 +1,5 @@
1
1
  // NavigationContext.js
2
2
  import React, { createContext, useContext, useState } from 'react';
3
- import { useFocusEffect } from '@react-navigation/native';
4
3
 
5
4
  const NavigationContext = createContext();
6
5
 
@@ -23,16 +22,14 @@ export const NavigationProvider = ({ children }) => {
23
22
  }
24
23
  };
25
24
 
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
- );
25
+ React.useEffect(() => {
26
+ if (navigationState && navigationState.length > 0) {
27
+ setFocusedScreen(navigationState[navigationState.length - 1].name);
28
+ }
29
+ return () => {
30
+ setFocusedScreen('');
31
+ };
32
+ }, [navigationState]);
36
33
 
37
34
  return (
38
35
  <NavigationContext.Provider value={{ navigationState, navigate, goBack, focusedScreen, goToScreenAtIndex}}>
@@ -6,7 +6,6 @@ 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';
10
9
  import GetLocation from '../../GetLocation'
11
10
  import NetInfo from '../../NetInfo/src'
12
11
  import { SessionStartApi } from '../APIs/StartSession';
@@ -53,7 +52,7 @@ global.isScreeenShotTaken = false;
53
52
  global.restrictedViews = [];
54
53
  global.currentScreen = ""
55
54
  global.isShakebugSDKOpen = false;
56
- global.sdk_version = "2.4.5";
55
+ global.sdk_version = "2.4.6";
57
56
  global.app_lunch_count = 0;
58
57
  global.POPUP_LAUNCH_THRESHOLD = 3;
59
58
  global.POPUP_COOLDOWN_DAYS = 2;
@@ -76,16 +75,14 @@ const NavigationContainer = ({ screens, setFocusedScreen }) => {
76
75
  const animation = React.useRef(new Animated.Value(0)).current;
77
76
  const { width } = Dimensions.get('window');
78
77
 
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
- );
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]);
89
86
 
90
87
  React.useEffect(() => {
91
88
  Animated.timing(animation, {
package/src/index.tsx CHANGED
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import Shakebug, { AddEvent } from '../src/Screens/Shakebug';
3
- import { NavigationContainer, findFocusedRoute } from '@react-navigation/native';
4
3
  import { getLocales } from '../GetLocals/src';
5
4
  import { NativeModules, Text, View, findNodeHandle } from 'react-native';
6
5
  import { useGlobalState } from './Componanats/GlobalStateContext'
@@ -14,7 +13,7 @@ let LocalLanguage = LanguageCodes.indexOf(getLocales()[0].languageCode)
14
13
 
15
14
 
16
15
  // Define the props interface for ShakebugView
17
- interface ShakebugViewProps {
16
+ export interface ShakebugViewProps {
18
17
  children?: React.ReactNode;
19
18
  Android_appkey?: string;
20
19
  iOS_appkey?: string;
@@ -47,22 +46,20 @@ const ShakebugView: React.FC<ShakebugViewProps> = ({
47
46
  }) => {
48
47
 
49
48
  return (
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>
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
+ />
66
63
  );
67
64
  };
68
65