shakebug-react-native 2.2.8 → 2.2.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/README.md CHANGED
@@ -26,12 +26,12 @@ Or if you prefer to use Yarn instead of npm:
26
26
  Make sure to install Required Libraries also
27
27
 
28
28
  ```bash
29
- npm i react-native-view-shot react-native-video react-native-video-trim
29
+ npm i react-native-view-shot react-native-video react-native-video-trim@3.0.9
30
30
  ```
31
31
  Or if you prefer to use Yarn instead of npm:
32
32
 
33
33
  ```bash
34
- yarn add react-native-view-shot react-native-video react-native-video-trim
34
+ yarn add react-native-view-shot react-native-video react-native-video-trim@3.0.9
35
35
  ```
36
36
 
37
37
 
@@ -140,20 +140,23 @@ export default App = () => {
140
140
 
141
141
  ```
142
142
 
143
- To ensure the privacy of your users' sensitive information, such as payment details or account information etc.., you can mark any view containing this information as private using ShakebugSdkProtectedView. By doing so, the private view will automatically appear with a black overlay in any screenshots taken and while recording screen:
143
+ Remote Code Execution
144
+
145
+ With Shakebug Remote Code, you can fetch dynamic configuration values based on predefined keys set in the Shakebug dashboard. It supports String, Number, Boolean, and JSON types and allows you to modify app behavior without a version update.
144
146
 
145
147
  ```javascript
146
148
 
147
149
  import { Button } from 'react-native';
148
- import { ShakebugSdkProtectedView } from 'react-native-shakebug';
150
+ import { fetchRemoteCodeValue } from 'react-native-shakebug';
149
151
 
150
152
  export default App = () => {
151
153
  return(
152
- <ShakebugSdkProtectedView>
153
- <View>
154
- <Text>This is sensitive information!</Text>
155
- </View>
156
- </ShakebugSdkProtectedView>
154
+ <Button
155
+ title='Prees'
156
+ onPress={async() => {
157
+ const result = await fetchRemoteCodeValue("test")
158
+ }}
159
+ />
157
160
  )
158
161
  }
159
162
 
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.2.8",
4
+ "version": "2.2.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": {
@@ -40,7 +40,7 @@ async function AddIssueApi(session_id, application_id, path, isVideo, desc, emai
40
40
  formData.append("applicationsid", application_id);
41
41
  formData.append("session_id", session_id);
42
42
  formData.append("batteryLevel", batteryLevel);
43
- formData.append("image", { uri: media, name: name, type: type });
43
+ formData.append("image", media);
44
44
  formData.append("memory", memory);
45
45
  formData.append("email", email);
46
46
  formData.append("devicemodel", `${architecture[0]} -- ${model}`);
@@ -0,0 +1,38 @@
1
+ import DeviceInfo from "../../DeviceInfo";
2
+
3
+ const BASE_URL = global.ShakebugSDKEndPointURL;
4
+ const API_KEY = global.ShakebugSDKEndPointURLheaderKey;
5
+
6
+ async function FetchRemoteCodeAPI(config_key, applicationsid) {
7
+
8
+ try {
9
+ const formData = new FormData();
10
+
11
+ formData.append("method", "remote_code");
12
+ formData.append("applicationsid", applicationsid);
13
+ formData.append("config_key", config_key);
14
+ formData.append("sdkversion", global.sdk_version);
15
+ formData.append("appVersion", DeviceInfo?.getVersion());
16
+
17
+ const response = await fetch(BASE_URL, {
18
+ method: "POST",
19
+ headers: {
20
+ "API-KEY": API_KEY,
21
+ },
22
+ body: formData,
23
+ });
24
+
25
+ const data = await response.json();
26
+
27
+ if (data.code === 200 && data.success === true) {
28
+ return { success: true, message: data.msg, data: data?.response_data?.value };
29
+ } else {
30
+ return { success: false, message: data.msg };
31
+ }
32
+ }
33
+ catch (error) {
34
+ return { success: false, message: error.message };
35
+ }
36
+ }
37
+
38
+ export { FetchRemoteCodeAPI };
@@ -38,7 +38,7 @@ global.isRecording = false
38
38
  global.isScreenShotDetected = false
39
39
  global.ShakebugLanguage = "ENGLISH"
40
40
  global.makeLogEnabled = false
41
- global.ShakebugSDKEndPointURL = "https://www.shakebug.com/api/v1.3/webservice.php/";
41
+ global.ShakebugSDKEndPointURL = "https://www.shakebug.com/api/v1.5/webservice.php/";
42
42
  global.ShakebugSDKEndPointURLheaderKey = 'MarchShake2022';
43
43
  global.AllowVideo = false;
44
44
  global.total_video = 0;
@@ -52,7 +52,7 @@ global.isScreeenShotTaken = false;
52
52
  global.restrictedViews = [];
53
53
  global.currentScreen = ""
54
54
  global.isShakebugSDKOpen = false;
55
- global.sdk_version = "2.2.8";
55
+ global.sdk_version = "2.2.9";
56
56
  global.app_lunch_count = 0;
57
57
  global.POPUP_LAUNCH_THRESHOLD = 3;
58
58
  global.POPUP_COOLDOWN_DAYS = 2;
@@ -70,7 +70,7 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
70
70
  const [showModal, setShowModal] = useState(false);
71
71
  global.ShakebugLanguage = ShakebugLanguage;
72
72
  global.makeLogEnabled = makeLogEnabled;
73
- global.ShakebugSDKEndPointURL = setShakebugSDKEndPointURL[0].length > 0 ? setShakebugSDKEndPointURL[0] : "https://www.shakebug.com/api/v1.4/webservice.php/";
73
+ global.ShakebugSDKEndPointURL = setShakebugSDKEndPointURL[0].length > 0 ? setShakebugSDKEndPointURL[0] : "https://www.shakebug.com/api/v1.5/webservice.php/";
74
74
  global.ShakebugSDKEndPointURLheaderKey = setShakebugSDKEndPointURL[1].length > 0 ? setShakebugSDKEndPointURL[1] : "MarchShake2022";
75
75
 
76
76
 
package/src/index.tsx CHANGED
@@ -5,6 +5,7 @@ import { getLocales } from '../GetLocals/src';
5
5
  import { NativeModules, Text, View, findNodeHandle } from 'react-native';
6
6
  import { useGlobalState } from './Componanats/GlobalStateContext'
7
7
  import { CustomUserIdApi } from './APIs/CustomUserId'
8
+ import { FetchRemoteCodeAPI } from './APIs/FetchRemoteCodeAPI';
8
9
 
9
10
  let Languages = ['ENGLISH', 'HINDI', 'GUJARATI', 'ARABIC', 'CHINESE', 'DUTCH', 'FRENCH', 'GERMAN', 'GREEK', 'INDONESIAN', 'ITALIAN', 'JAPANESE', 'KOREAN', 'RUSSIAN', 'SPANISH', 'TURKISH', 'UKRAINIAN', 'MARATHI', 'TAMIL', 'TELUGU']
10
11
  let LanguageCodes = ['en', 'hi', 'gu', 'ar', 'zh', 'nl', 'fr', 'de', 'el', 'id', 'it', 'ja', 'ko', 'ru', 'es', 'tr', 'uk', 'mr', 'ta', 'te']
@@ -42,7 +43,7 @@ const ShakebugView: React.FC<ShakebugViewProps> = ({
42
43
  allowCrashReport = true,
43
44
  makeLogEnabled = false,
44
45
  ShakebugLanguage = LocalLanguage != -1 ? Languages[LocalLanguage] : "ENGLISH",
45
- setShakebugSDKEndPointURL = ["https://www.shakebug.com/api/v1.4/webservice.php/", "MarchShake2022", ""]
46
+ setShakebugSDKEndPointURL = ["https://www.shakebug.com/api/v1.5/webservice.php/", "MarchShake2022", ""]
46
47
  }) => {
47
48
 
48
49
  return (
@@ -116,6 +117,22 @@ export const IsShakebugSDKOpen = () => {
116
117
  return global.isShakebugSDKOpen;
117
118
  }
118
119
 
119
- export const addCustomUser = (id, name, email, country, other, applicationsid) => {
120
- CustomUserIdApi(id, name, email, country, other, applicationsid)
120
+ export const addCustomUser = (id, name, email, country, other) => {
121
+ CustomUserIdApi(id, name, email, country, other, global.application_id)
122
+ }
123
+
124
+ export const fetchRemoteCodeValue = async (key: String) => {
125
+ try {
126
+ const result = await FetchRemoteCodeAPI(key, global.application_id);
127
+
128
+ if (result?.success) {
129
+ return result?.data
130
+ }
131
+ else {
132
+ return result?.message
133
+ }
134
+ }
135
+ catch (e) {
136
+ return "Something went wrong, Please try again later!"
137
+ }
121
138
  }