shakebug-react-native 1.0.20 → 2.1.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shakebug-react-native",
3
3
  "title": "shakebug-react-native",
4
- "version": "1.0.20",
4
+ "version": "2.1.0",
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": {
@@ -17,7 +17,8 @@
17
17
  "crash",
18
18
  "errors",
19
19
  "reporting",
20
- "feedback"
20
+ "feedback",
21
+ "tool"
21
22
  ],
22
23
  "author": {
23
24
  "name": "Softnoesis Pvt. Ltd.",
@@ -1,3 +1,4 @@
1
+ import { NativeModules } from "react-native";
1
2
  import DeviceInfo from "../../DeviceInfo";
2
3
  import { getLocales } from "../../GetLocals/src";
3
4
 
@@ -9,6 +10,8 @@ async function SessionStartApi(latitude, longitude, application_id) {
9
10
  let city = "";
10
11
  let state = ""
11
12
 
13
+ const { ShakebugSDKSharedPreferencesModule } = NativeModules;
14
+
12
15
  if (latitude != "" && latitude != undefined && longitude != "" && longitude != undefined) {
13
16
  try {
14
17
  await fetch(
@@ -22,13 +25,23 @@ async function SessionStartApi(latitude, longitude, application_id) {
22
25
  }
23
26
  catch (err) {
24
27
  // console.log("err", err)
25
- throw err
28
+ // throw err
26
29
  }
27
30
  }
28
31
 
29
32
  let locals = getLocales()
30
33
 
31
- let uuid = await DeviceInfo.getUniqueId()
34
+ let uuid = null;
35
+ let idFromStorege = await ShakebugSDKSharedPreferencesModule.getString("uuid");
36
+
37
+ if (idFromStorege == "" || idFromStorege == undefined) {
38
+ let id = await DeviceInfo.getUniqueId();
39
+ ShakebugSDKSharedPreferencesModule.setString("uuid", id)
40
+ uuid = id;
41
+ }
42
+ else {
43
+ uuid = idFromStorege;
44
+ }
32
45
 
33
46
  let system_version = await DeviceInfo.getSystemVersion()
34
47
 
@@ -281,7 +281,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
281
281
  }
282
282
 
283
283
  return (
284
- <SafeAreaView style={{ width: "100%", height: Dimensions.get('screen').height - StatusBar.currentHeight, backgroundColor: themeColor, marginTop: Platform.OS == 'ios' ? StatusBar.currentHeight : 0, paddingBottom: 0 }}>
284
+ <SafeAreaView style={{ width: "100%", height: Dimensions.get('window').height, backgroundColor: themeColor, marginTop: Platform.OS == 'ios' ? StatusBar.currentHeight : 0, paddingBottom: 0 }}>
285
285
  <StatusBar backgroundColor={ThemeColor} hidden={false} />
286
286
  <KeyboardAvoidingWrapper>
287
287
  <>
@@ -418,7 +418,7 @@ const AddDetailsScreen = ({ media, updateParent, mediaType, themeColor, SDKScree
418
418
  </View>
419
419
 
420
420
  <View style={{ alignItems: 'flex-end', marginHorizontal: 15, marginTop: '1%' }}>
421
- <Text style={{ fontSize: 16, color: "black" }}>© <Text>ShakeBug v1.0</Text></Text>
421
+ <Text style={{ fontSize: 12, color: "gray", fontWeight: '300' }}>© <Text>ShakeBug v2.1</Text></Text>
422
422
  </View>
423
423
 
424
424
  </View>
@@ -310,7 +310,7 @@ const FirstScreen = ({ img, themeColor, SDKScreenTitle }) => {
310
310
  // backgroundColor: "#181818"
311
311
 
312
312
  return (
313
- <SafeAreaView style={{ width: "100%", height: Dimensions.get('screen').height - StatusBar.currentHeight, backgroundColor: themeColor, marginTop: Platform.OS == 'ios' ? StatusBar.currentHeight : 0}}>
313
+ <SafeAreaView style={{ width: "100%", height: Dimensions.get('window').height, backgroundColor: themeColor, marginTop: Platform.OS == 'ios' ? StatusBar.currentHeight : 0}}>
314
314
  <StatusBar backgroundColor={ThemeColor} />
315
315
 
316
316
  <View style={{ width: "100%", height: "100%", backgroundColor: "#e4fdfd" }}>
package/src/index.tsx CHANGED
@@ -55,7 +55,7 @@ const ShakebugView: React.FC<ShakebugViewProps> = ({
55
55
  changeSDKScreenTitle={changeSDKScreenTitle}
56
56
  allowToReportBugByScreenCapture={allowToReportBugByScreenCapture}
57
57
  allowToReportBugByShakingMobile={allowToReportBugByShakingMobile}
58
- allowCrashReport={allowCrashReport}
58
+ allowCrashReport={__DEV__ ? false : allowCrashReport}
59
59
  makeLogEnabled={makeLogEnabled}
60
60
  ShakebugLanguage={Languages.includes(ShakebugLanguage) ? ShakebugLanguage : LocalLanguage != -1 ? Languages[LocalLanguage] : "ENGLISH"}
61
61
  setShakebugSDKEndPointURL={setShakebugSDKEndPointURL}
@@ -77,7 +77,7 @@ export const triggerBugReporting = (): void => {
77
77
  }
78
78
 
79
79
 
80
- export const ShakebugSdkProtectedView = ( {children}) => {
80
+ export const ShakebugSdkProtectedView = ({ children }) => {
81
81
 
82
82
  const { isRecordingStart, isScreenShot } = useGlobalState();
83
83
  if (isRecordingStart == true || isScreenShot == true) {