Skip to content

Commit 6460410

Browse files
Enable setPromptOptionsEnabled API
1 parent 7ca40c4 commit 6460410

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,26 @@ public void run() {
10251025
}
10261026
}
10271027

1028+
/**
1029+
* Enable/Disable prompt options when SDK invoked. When only a single option is enabled it
1030+
* becomes the default
1031+
* invocation option that SDK gets invoked with and prompt options screen will not show. When
1032+
* none is enabled, Bug
1033+
* reporting becomes the default invocation option.
1034+
*
1035+
* @param {boolean} chat weather Talk to us is enable or not
1036+
* @param {boolean} bug weather Report a Problem is enable or not
1037+
* @param {boolean} feedback weather General Feedback is enable or not
1038+
* */
1039+
@ReactMethod
1040+
public void setPromptOptionsEnabled(boolean chat, boolean bug, boolean feedback) {
1041+
try {
1042+
mInstabug.setPromptOptionsEnabled(chat, bug, feedback);
1043+
} catch (Exception e) {
1044+
e.printStackTrace();
1045+
}
1046+
}
1047+
10281048
private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
10291049
String keyInLowerCase = key.toLowerCase();
10301050
switch (keyInLowerCase) {

index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,22 @@ module.exports = {
675675

676676
},
677677

678+
/**
679+
* Enable/Disable prompt options when SDK invoked. When only a single option is enabled it
680+
* becomes the default
681+
* invocation option that SDK gets invoked with and prompt options screen will not show. When
682+
* none is enabled, Bug
683+
* reporting becomes the default invocation option.
684+
*
685+
* @param {boolean} chat weather Talk to us is enable or not
686+
* @param {boolean} bug weather Report a Problem is enable or not
687+
* @param {boolean} feedback weather General Feedback is enable or not
688+
* */
689+
setPromptOptionsEnabled: function (chat, bug, feedback) {
690+
Instabug.setPromptOptionsEnabled(chat, bug, feedback);
691+
},
692+
693+
678694
/**
679695
* The event used to invoke the feedback form
680696
* @readonly

0 commit comments

Comments
 (0)