Skip to content

Commit 81e5955

Browse files
Enable setWillSkipScreenshotAnnotation API for android
1 parent 4860899 commit 81e5955

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,25 @@ public void setStringToKey(String string, String key) {
806806
@ReactMethod
807807
public void logOut() {
808808
try {
809-
Instabug.logoutUser();
809+
mInstabug.logoutUser();
810+
} catch (java.lang.Exception exception) {
811+
exception.printStackTrace();
812+
}
813+
}
814+
815+
/**
816+
* Enables/disables screenshot view when reporting a bug/improvement.
817+
* By default, screenshot view is shown when reporting a bug, but not when
818+
* sending feedback.
819+
*
820+
* @param {boolean} willSkipScreenshotAnnotation sets whether screenshot view is
821+
* shown or not. Passing YES will show screenshot view for both feedback and
822+
* bug reporting, while passing NO will disable it for both.
823+
*/
824+
@ReactMethod
825+
public void setWillSkipScreenshotAnnotation(boolean willSkipScreenshotAnnotation) {
826+
try {
827+
mInstabug.setWillSkipScreenshotAnnotation(willSkipScreenshotAnnotation);
810828
} catch (java.lang.Exception exception) {
811829
exception.printStackTrace();
812830
}

index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ module.exports = {
188188
* bug reporting, while passing NO will disable it for both.
189189
*/
190190
setWillSkipScreenshotAnnotation: function (willSkipScreenshotAnnotation) {
191-
if (Platform.OS === 'ios') {
192-
Instabug.setWillSkipScreenshotAnnotation(willSkipScreenshotAnnotation);
193-
}
191+
Instabug.setWillSkipScreenshotAnnotation(willSkipScreenshotAnnotation);
194192
},
195193

196194
/**

0 commit comments

Comments
 (0)