Skip to content

Commit 8c5258e

Browse files
Enable clearFileAttachment API for android
1 parent 6460410 commit 8c5258e

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,10 +1032,10 @@ public void run() {
10321032
* none is enabled, Bug
10331033
* reporting becomes the default invocation option.
10341034
*
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-
* */
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+
*/
10391039
@ReactMethod
10401040
public void setPromptOptionsEnabled(boolean chat, boolean bug, boolean feedback) {
10411041
try {
@@ -1045,6 +1045,20 @@ public void setPromptOptionsEnabled(boolean chat, boolean bug, boolean feedback)
10451045
}
10461046
}
10471047

1048+
/**
1049+
* Clears all Uris of the attached files.
1050+
* The URIs which added via {@link Instabug#addFileAttachment} API not the physical files.
1051+
*/
1052+
@ReactMethod
1053+
public void clearFileAttachment() {
1054+
try {
1055+
mInstabug.clearFileAttachment();
1056+
} catch (Exception e) {
1057+
e.printStackTrace();
1058+
}
1059+
},
1060+
1061+
10481062
private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
10491063
String keyInLowerCase = key.toLowerCase();
10501064
switch (keyInLowerCase) {

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,13 @@ module.exports = {
690690
Instabug.setPromptOptionsEnabled(chat, bug, feedback);
691691
},
692692

693+
/**
694+
* Clears all Uris of the attached files.
695+
* The URIs which added via {@link Instabug#addFileAttachment} API not the physical files.
696+
*/
697+
clearFileAttachment: function () {
698+
Instabug.clearFileAttachment();
699+
},
693700

694701
/**
695702
* The event used to invoke the feedback form

0 commit comments

Comments
 (0)