shakebug-react-native 2.3.0 → 2.3.2
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 +2 -2
- package/src/APIs/MatchKey.js +2 -1
- package/src/Screens/Shakebug.js +16 -3
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.3.
|
|
4
|
+
"version": "2.3.2",
|
|
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": {
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
"flow-bin": "^0.170.0",
|
|
43
43
|
"html-webpack-plugin": "^5.5.1"
|
|
44
44
|
}
|
|
45
|
-
}
|
|
45
|
+
}
|
package/src/APIs/MatchKey.js
CHANGED
|
@@ -27,7 +27,8 @@ async function MatchKeyApi(appkey, BundleId) {
|
|
|
27
27
|
const total_video = data.response_data.total_video;
|
|
28
28
|
const used_video = data.response_data.used_video;
|
|
29
29
|
const video_duration = data.response_data.video_duration;
|
|
30
|
-
|
|
30
|
+
const shakebug_type = data.response_data.shakebug_type;
|
|
31
|
+
return { success: true, application_id, total_mau, used_mau, total_video, used_video, video_duration, shakebug_type, message: data.msg };
|
|
31
32
|
} else {
|
|
32
33
|
return { success: false, message: data.msg };
|
|
33
34
|
}
|
package/src/Screens/Shakebug.js
CHANGED
|
@@ -57,6 +57,14 @@ global.app_lunch_count = 0;
|
|
|
57
57
|
global.POPUP_LAUNCH_THRESHOLD = 3;
|
|
58
58
|
global.POPUP_COOLDOWN_DAYS = 2;
|
|
59
59
|
global.KEY_REVIEW_SUBMITTED = false;
|
|
60
|
+
global.shakebug_type = "1";
|
|
61
|
+
global.isFeatureEnabled = (featureCode) => {
|
|
62
|
+
if (!global.shakebug_type) return true;
|
|
63
|
+
const types = global.shakebug_type.split(',');
|
|
64
|
+
if (types.includes('0')) return false;
|
|
65
|
+
if (types.includes('1')) return true;
|
|
66
|
+
return types.includes(featureCode);
|
|
67
|
+
};
|
|
60
68
|
|
|
61
69
|
function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirstTime, ShakebugThemeColor, changeSDKScreenTitle, allowToReportBugByShakingMobile, allowToReportBugByScreenCapture, allowCrashReport, ShakebugLanguage, makeLogEnabled, setShakebugSDKEndPointURL }) {
|
|
62
70
|
|
|
@@ -157,12 +165,12 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
157
165
|
const afterDaysTimestamp = now + sevenDaysInMs;
|
|
158
166
|
|
|
159
167
|
if (LAST_POPUP_TIME > afterDaysTimestamp) {
|
|
160
|
-
setShowModal(true)
|
|
168
|
+
if (!global.isFeatureEnabled || global.isFeatureEnabled('6')) setShowModal(true)
|
|
161
169
|
}
|
|
162
170
|
|
|
163
171
|
}
|
|
164
172
|
else if (IS_REVIEW_SUBMITTED != "true") {
|
|
165
|
-
setShowModal(true)
|
|
173
|
+
if (!global.isFeatureEnabled || global.isFeatureEnabled('6')) setShowModal(true)
|
|
166
174
|
}
|
|
167
175
|
}
|
|
168
176
|
|
|
@@ -304,11 +312,14 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
304
312
|
try {
|
|
305
313
|
let BundleId = DeviceInfo.getBundleId();
|
|
306
314
|
|
|
307
|
-
const { success, application_id: newApplication_id, message, total_mau, used_mau, total_video, used_video, video_duration } = await MatchKeyApi(appkey, BundleId);
|
|
315
|
+
const { success, application_id: newApplication_id, message, total_mau, used_mau, total_video, used_video, video_duration, shakebug_type } = await MatchKeyApi(appkey, BundleId);
|
|
308
316
|
|
|
309
317
|
global.videoDuration = video_duration;
|
|
310
318
|
|
|
311
319
|
if (success) {
|
|
320
|
+
if (shakebug_type) {
|
|
321
|
+
global.shakebug_type = shakebug_type.toString();
|
|
322
|
+
}
|
|
312
323
|
if (total_video == "Unlimited") {
|
|
313
324
|
global.AllowVideo = true;
|
|
314
325
|
}
|
|
@@ -362,6 +373,7 @@ function Shakebug({ children, Android_appkey, iOS_appkey, showTutorialScreenFirs
|
|
|
362
373
|
|
|
363
374
|
// For call Startsesstion and get session id
|
|
364
375
|
const StartSession = async () => {
|
|
376
|
+
if (global.isFeatureEnabled && !global.isFeatureEnabled('3')) return;
|
|
365
377
|
if (global.session_id == "") {
|
|
366
378
|
try {
|
|
367
379
|
const { success, session_id: newSessionId, message } = await SessionStartApi(global.latitude, global.longitude, global.application_id);
|
|
@@ -483,6 +495,7 @@ export default Shakebug;
|
|
|
483
495
|
|
|
484
496
|
// For add event api
|
|
485
497
|
export const AddEvent = async (name, value) => {
|
|
498
|
+
if (global.isFeatureEnabled && !global.isFeatureEnabled('5')) return;
|
|
486
499
|
|
|
487
500
|
const defaultConfig = {
|
|
488
501
|
levels: {
|