Skip to content

Commit 712016c

Browse files
Enable identifyUser APIs in android
1 parent 1814b37 commit 712016c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,22 @@ public ArrayList<String> getTags() {
320320
return tags;
321321
}
322322

323+
/**
324+
* Set the user identity.
325+
* Instabug will pre-fill the user email in reports.
326+
*
327+
* @param username Username.
328+
* @param email User's default email
329+
*/
330+
@ReactMethod
331+
public void identifyUser(String userName, String userEmail) {
332+
try {
333+
mInstabug.identifyUser(userName, userEmail);
334+
} catch (Exception e) {
335+
e.printStackTrace();
336+
}
337+
}
338+
323339
/**
324340
* Reset ALL tags added using {@link #addTags(String...)}
325341
*/

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ module.exports = {
437437
identifyUserWithEmail: function (email, name) {
438438
if (Platform.OS == 'ios') {
439439
Instabug.identifyUserWithEmail(email, name);
440+
} else if ('android') {
441+
Instabug.identifyUser(name, email);
440442
}
441443
},
442444

0 commit comments

Comments
 (0)