mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-03 14:40:54 +00:00
Align APIs
This commit is contained in:
parent
e157086518
commit
57f716367b
@ -7,7 +7,7 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"instabug-reactnative": "git+https://github.com/Instabug/instabug-reactnative.git#master",
|
||||
"instabug-reactnative": "file:../",
|
||||
"react": "15.4.2",
|
||||
"react-native": "^0.41.2",
|
||||
"react-native-dialogs": "0.0.19"
|
||||
|
85
index.js
85
index.js
@ -413,23 +413,6 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enables/disables prompt options when SDK is invoked.
|
||||
* When only a single option is enabled, it become the default invocation mode.
|
||||
* If all options are disabled, bug reporting becomes the default invocation mode.
|
||||
* By default, all three options are enabled.
|
||||
* @param {boolean} isBugReportingEnabled A boolean to indicate whether bug reports
|
||||
* are enabled or disabled.
|
||||
* @param {boolean} isFeedbackReportingEnabled A boolean to indicate whether feedback is
|
||||
* enabled or disabled.
|
||||
* @param {boolean} isChatEnabled A boolean to indicate whether chat is enabled
|
||||
* or disabled.
|
||||
*/
|
||||
setPromptOptions: function (isBugReportingEnabled, isFeedbackReportingEnabled, isChatEnabled) {
|
||||
if (Platform.OS === 'ios')
|
||||
Instabug.setPromptOptions(isBugReportingEnabled, isFeedbackReportingEnabled, isChatEnabled);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if a notification is from Instabug.
|
||||
* If you are using push notifications, use this method to check whether an
|
||||
@ -445,17 +428,6 @@ module.exports = {
|
||||
Instabug.isInstabugNotification(dict, isInstabugNotificationCallback);
|
||||
},
|
||||
|
||||
/**
|
||||
* Shows/Hides email field.
|
||||
* Defaults to show email field.
|
||||
* @param {boolean} shouldShowEmailField true to show the email field, false to hide it.
|
||||
*/
|
||||
setShowEmailField: function (shouldShowEmailField) {
|
||||
if (Platform.OS == 'ios') {
|
||||
Instabug.setShowEmailField();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the default value of the user's email and hides the email field from the reporting UI
|
||||
* and set the user's name to be included with all reports.
|
||||
@ -479,17 +451,6 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets whether to show a "Thank You" dialog after a bug report is sent or not.
|
||||
* Defaults to YES.
|
||||
* @param {boolean} isPostSendingDialogEnabled A boolean to indicate whether the dialog is enabled or not.
|
||||
*/
|
||||
setPostSendingDialogEnabled: function (isPostSendingDialogEnabled) {
|
||||
if (Platform.OS == 'ios') {
|
||||
Instabug.setPostSendingDialogEnabled(isPostSendingDialogEnabled);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets an array of report categories to be shown for users to select from before reporting a bug or sending
|
||||
* feedback.
|
||||
@ -505,16 +466,6 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enables/disables inspect view hierarchy when reporting a bug/feedback.
|
||||
* @param {boolean} viewHierarchyEnabled A boolean to set whether view hierarchy are enabled or disabled.
|
||||
*/
|
||||
setViewHierarchyEnabled: function (viewHierarchyEnabled) {
|
||||
if (Platform.OS == 'ios') {
|
||||
Instabug.setViewHierarchyEnabled(viewHierarchyEnabled);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Logs a user event that happens through the lifecycle of the application.
|
||||
* 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 = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Appends a log message to Instabug internal log
|
||||
* <p>
|
||||
* These logs are then sent along the next uploaded report.
|
||||
* All log messages are timestamped <br/>
|
||||
* Logs aren't cleared per single application run.
|
||||
* If you wish to reset the logs,
|
||||
* use {@link #clearLogs()} ()}
|
||||
* </p>
|
||||
* Note: logs passed to this method are <b>NOT</b> printed to Logcat
|
||||
*
|
||||
* @param message the message
|
||||
*/
|
||||
logWTF(message){
|
||||
if (!message)return;
|
||||
if (Platform.OS === 'android') {
|
||||
Instabug.log("wtf", message);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Clears Instabug internal log
|
||||
*
|
||||
*/
|
||||
clearLogs: function () {
|
||||
if (Platform.OS === 'android') {
|
||||
Instabug.clearLogs();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets user attribute to overwrite it's value or create a new one if it doesn't exist.
|
||||
*
|
||||
@ -687,9 +608,7 @@ module.exports = {
|
||||
setUserAttribute: function (key, value) {
|
||||
if (!key || !value || typeof key !== "string" || typeof value !== "string")
|
||||
throw new TypeError("Invalid param, Expected String");
|
||||
if (Platform.OS === 'android') {
|
||||
Instabug.setUserAttribute(key, value);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -713,9 +632,7 @@ module.exports = {
|
||||
removeUserAttribute: function (key) {
|
||||
if (!key || typeof key !== "string")
|
||||
throw new TypeError("Invalid param, Expected String");
|
||||
if (Platform.OS === 'android') {
|
||||
Instabug.removeUserAttribute(key);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -733,9 +650,7 @@ module.exports = {
|
||||
* Clears all user attributes if exists.
|
||||
*/
|
||||
clearAllUserAttributes: function () {
|
||||
if (Platform.OS === 'android') {
|
||||
Instabug.clearAllUserAttributes();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user