Skip to content

Commit 57f7163

Browse files
committed
Align APIs
1 parent e157086 commit 57f7163

File tree

2 files changed

+4
-89
lines changed

2 files changed

+4
-89
lines changed

InstabugSample/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"instabug-reactnative": "git+https://github.com/Instabug/instabug-reactnative.git#master",
10+
"instabug-reactnative": "file:../",
1111
"react": "15.4.2",
1212
"react-native": "^0.41.2",
1313
"react-native-dialogs": "0.0.19"

index.js

Lines changed: 3 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -413,23 +413,6 @@ module.exports = {
413413
}
414414
},
415415

416-
/**
417-
* Enables/disables prompt options when SDK is invoked.
418-
* When only a single option is enabled, it become the default invocation mode.
419-
* If all options are disabled, bug reporting becomes the default invocation mode.
420-
* By default, all three options are enabled.
421-
* @param {boolean} isBugReportingEnabled A boolean to indicate whether bug reports
422-
* are enabled or disabled.
423-
* @param {boolean} isFeedbackReportingEnabled A boolean to indicate whether feedback is
424-
* enabled or disabled.
425-
* @param {boolean} isChatEnabled A boolean to indicate whether chat is enabled
426-
* or disabled.
427-
*/
428-
setPromptOptions: function (isBugReportingEnabled, isFeedbackReportingEnabled, isChatEnabled) {
429-
if (Platform.OS === 'ios')
430-
Instabug.setPromptOptions(isBugReportingEnabled, isFeedbackReportingEnabled, isChatEnabled);
431-
},
432-
433416
/**
434417
* Checks if a notification is from Instabug.
435418
* If you are using push notifications, use this method to check whether an
@@ -445,17 +428,6 @@ module.exports = {
445428
Instabug.isInstabugNotification(dict, isInstabugNotificationCallback);
446429
},
447430

448-
/**
449-
* Shows/Hides email field.
450-
* Defaults to show email field.
451-
* @param {boolean} shouldShowEmailField true to show the email field, false to hide it.
452-
*/
453-
setShowEmailField: function (shouldShowEmailField) {
454-
if (Platform.OS == 'ios') {
455-
Instabug.setShowEmailField();
456-
}
457-
},
458-
459431
/**
460432
* Sets the default value of the user's email and hides the email field from the reporting UI
461433
* and set the user's name to be included with all reports.
@@ -479,17 +451,6 @@ module.exports = {
479451
}
480452
},
481453

482-
/**
483-
* Sets whether to show a "Thank You" dialog after a bug report is sent or not.
484-
* Defaults to YES.
485-
* @param {boolean} isPostSendingDialogEnabled A boolean to indicate whether the dialog is enabled or not.
486-
*/
487-
setPostSendingDialogEnabled: function (isPostSendingDialogEnabled) {
488-
if (Platform.OS == 'ios') {
489-
Instabug.setPostSendingDialogEnabled(isPostSendingDialogEnabled);
490-
}
491-
},
492-
493454
/**
494455
* Sets an array of report categories to be shown for users to select from before reporting a bug or sending
495456
* feedback.
@@ -505,16 +466,6 @@ module.exports = {
505466
}
506467
},
507468

508-
/**
509-
* Enables/disables inspect view hierarchy when reporting a bug/feedback.
510-
* @param {boolean} viewHierarchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
511-
*/
512-
setViewHierarchyEnabled: function (viewHierarchyEnabled) {
513-
if (Platform.OS == 'ios') {
514-
Instabug.setViewHierarchyEnabled(viewHierarchyEnabled);
515-
}
516-
},
517-
518469
/**
519470
* Logs a user event that happens through the lifecycle of the application.
520471
* Logged user events are going to be sent with each report, as well as at the end of a session.
@@ -648,36 +599,6 @@ module.exports = {
648599
}
649600
},
650601

651-
/**
652-
* Appends a log message to Instabug internal log
653-
* <p>
654-
* These logs are then sent along the next uploaded report.
655-
* All log messages are timestamped <br/>
656-
* Logs aren't cleared per single application run.
657-
* If you wish to reset the logs,
658-
* use {@link #clearLogs()} ()}
659-
* </p>
660-
* Note: logs passed to this method are <b>NOT</b> printed to Logcat
661-
*
662-
* @param message the message
663-
*/
664-
logWTF(message){
665-
if (!message)return;
666-
if (Platform.OS === 'android') {
667-
Instabug.log("wtf", message);
668-
}
669-
},
670-
671-
/**
672-
* Clears Instabug internal log
673-
*
674-
*/
675-
clearLogs: function () {
676-
if (Platform.OS === 'android') {
677-
Instabug.clearLogs();
678-
}
679-
},
680-
681602
/**
682603
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
683604
*
@@ -687,9 +608,7 @@ module.exports = {
687608
setUserAttribute: function (key, value) {
688609
if (!key || !value || typeof key !== "string" || typeof value !== "string")
689610
throw new TypeError("Invalid param, Expected String");
690-
if (Platform.OS === 'android') {
691-
Instabug.setUserAttribute(key, value);
692-
}
611+
Instabug.setUserAttribute(key, value);
693612
},
694613

695614
/**
@@ -713,9 +632,7 @@ module.exports = {
713632
removeUserAttribute: function (key) {
714633
if (!key || typeof key !== "string")
715634
throw new TypeError("Invalid param, Expected String");
716-
if (Platform.OS === 'android') {
717-
Instabug.removeUserAttribute(key);
718-
}
635+
Instabug.removeUserAttribute(key);
719636
},
720637

721638
/**
@@ -733,9 +650,7 @@ module.exports = {
733650
* Clears all user attributes if exists.
734651
*/
735652
clearAllUserAttributes: function () {
736-
if (Platform.OS === 'android') {
737-
Instabug.clearAllUserAttributes();
738-
}
653+
Instabug.clearAllUserAttributes();
739654
},
740655

741656
/**

0 commit comments

Comments
 (0)