Enable setPromptOptionsEnabled API

This commit is contained in:
DevHossamHassan 2017-06-22 13:43:38 +02:00
parent 7ca40c4db4
commit 646041064b
2 changed files with 36 additions and 0 deletions

View File

@ -1025,6 +1025,26 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule {
}
}
/**
* Enable/Disable prompt options when SDK invoked. When only a single option is enabled it
* becomes the default
* invocation option that SDK gets invoked with and prompt options screen will not show. When
* none is enabled, Bug
* reporting becomes the default invocation option.
*
* @param {boolean} chat weather Talk to us is enable or not
* @param {boolean} bug weather Report a Problem is enable or not
* @param {boolean} feedback weather General Feedback is enable or not
* */
@ReactMethod
public void setPromptOptionsEnabled(boolean chat, boolean bug, boolean feedback) {
try {
mInstabug.setPromptOptionsEnabled(chat, bug, feedback);
} catch (Exception e) {
e.printStackTrace();
}
}
private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
String keyInLowerCase = key.toLowerCase();
switch (keyInLowerCase) {

View File

@ -675,6 +675,22 @@ module.exports = {
},
/**
* Enable/Disable prompt options when SDK invoked. When only a single option is enabled it
* becomes the default
* invocation option that SDK gets invoked with and prompt options screen will not show. When
* none is enabled, Bug
* reporting becomes the default invocation option.
*
* @param {boolean} chat weather Talk to us is enable or not
* @param {boolean} bug weather Report a Problem is enable or not
* @param {boolean} feedback weather General Feedback is enable or not
* */
setPromptOptionsEnabled: function (chat, bug, feedback) {
Instabug.setPromptOptionsEnabled(chat, bug, feedback);
},
/**
* The event used to invoke the feedback form
* @readonly