Is there any good react native library to get primary email address of android devices. There is a Stackoverflow question to get it with native android (link). I need include it in react native android app.
Update: I could get email address from following method with android native. Now I need to implement it in react native.
permission:
uses-permission android:name="android.permission.GET_ACCOUNTS"
method:
String emailAddress = "";
private String getEmail() {
int i = 0;
try {
Account[] accounts = AccountManager.get(this).getAccountsByType(
"com.google");
for (Account account : accounts) {
if (i > 0)
sGoogleId = account.name;
else
sGoogleId = account.name;
i++;
}
} catch (Exception e) {
// TODO: handle exception
}
return emailAddress;
}