Skip to content

Commit 4860899

Browse files
Enable LogOut API for android
1 parent 3365be2 commit 4860899

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,21 @@ public void setStringToKey(String string, String key) {
797797
}
798798
}
799799

800+
/**
801+
* Sets the default value of the user's email to null and show email field and remove user
802+
* name from all reports
803+
* It also reset the chats on device and removes user attributes, user data and completed
804+
* surveys.
805+
*/
806+
@ReactMethod
807+
public void logOut() {
808+
try {
809+
Instabug.logoutUser();
810+
} catch (java.lang.Exception exception) {
811+
exception.printStackTrace();
812+
}
813+
}
814+
800815
private InstabugCustomTextPlaceHolder.Key getStringToKeyConstant(String key) {
801816
String keyInLowerCase = key.toLowerCase();
802817
switch (keyInLowerCase) {

index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ module.exports = {
438438
* It also reset the chats on device and removes user attributes, user data and completed surveys.
439439
*/
440440
logOut: function () {
441-
if (Platform.OS == 'ios') {
442-
Instabug.logOut();
443-
}
441+
Instabug.logOut();
444442
},
445443

446444
/**

0 commit comments

Comments
 (0)