diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index ea3425e..434437f 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -320,6 +320,22 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { return tags; } + /** + * Set the user identity. + * Instabug will pre-fill the user email in reports. + * + * @param username Username. + * @param email User's default email + */ + @ReactMethod + public void identifyUser(String userName, String userEmail) { + try { + mInstabug.identifyUser(userName, userEmail); + } catch (Exception e) { + e.printStackTrace(); + } + } + /** * Reset ALL tags added using {@link #addTags(String...)} */ diff --git a/index.js b/index.js index a87128d..d39b6aa 100644 --- a/index.js +++ b/index.js @@ -437,6 +437,8 @@ module.exports = { identifyUserWithEmail: function (email, name) { if (Platform.OS == 'ios') { Instabug.identifyUserWithEmail(email, name); + } else if ('android') { + Instabug.identifyUser(name, email); } },