I am using phonegap and I would like to be able to get the current users email address from either the play store or connect store.
I have tried using this plugin for phonegap: https://github.com/song10/AccountListPlugin
Other than this, I know its not floating around in the DOM
so now I am a little stuck.
EDIT
I've found this thread: How to get the Android device's primary e-mail address
Which suggests this:
Pattern emailPattern = Patterns.EMAIL_ADDRESS; // API level 8+
Account[] accounts = AccountManager.get(context).getAccounts();
for (Account account : accounts) {
if (emailPattern.matcher(account.name).matches()) {
String possibleEmail = account.name;
...
}
}
Now to me, as a FrontEnd dev seems like drivle. Still, maybe there is a way in phonegap