-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cordova.plugins.email.hasAccount always returns false on Android 10 #350
Comments
indeed I tested now on Android 11 with one Gmail account with cordova.plugins.email.hasAccount((res)=> console.log(res)) and got Tested with another device with Android 9 and got |
I will test your PR in Android 9 and 11 with
I suppose this does work (saw here) |
@regnete To solve this issue, please do kindly submit a new PR from the current head of master and test it with Android 11. |
I am following the problem with interest. I am facing the same problem that hasAccount () is not working. In my case on Android 11 + SDK 30 |
@r000bin97 you can try to test @regnete 's PR #351
It crashed on my side when I tested it You can also try to improve that PR in case of crash and submit a new one :) |
Thanks for the hint, but unfortunately I then have exactly the same problem. I've already tried all of the fixes that I found on github. None has worked so far |
@r000bin97 did you test it with the following in <config-file target="app/src/main/AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
</config-file> |
cordova.plugins.email.hasAccount alsways returns false on Android 10 even if on or more accounts are configured on the device.
I tracked it down to a permission issue (see https://stackoverflow.com/a/54941079/4094951) and will shortly provide a pull request containing a fix.
Details:
For Android 10 to have to declare the additional permisson READ_CONTACTS in AndroidManifest.xml and you also have to request that permission on runtime. Otherwise AccountManager.get(ctx).getAccounts() will always return an empty array.
The text was updated successfully, but these errors were encountered: