diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index 1f63a87..1341573 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -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) { diff --git a/index.js b/index.js index dedaf84..de4e6e1 100644 --- a/index.js +++ b/index.js @@ -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