-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Workaround for Location Auth Status being DENIED_ALWAYS #486
Comments
As outlined in #422, the issue here is that on Android 11+, granting permission "Only this time"/"Ask everytime" means that permission is granted only for the duration of the current app session: when the app is restarted, permission is revoked. This worked fine up until Android 10, however the "Only this time" option added in Android 11 causes a problem: Therefore is no programmatic solution that the plugin can implement to solve this - it is a deficiency in the Android permission states model. There is however a workaround, as outlined in this comment. I think this is worth bringing into the main plugin documentation so I'll add a section to the |
Thanks a lot! I have used the workaround in my app. Just a note on the new commit in the readme, there is a small typo in there On line 3818, the final "case" in the switch should probably be |
Bug report
CHECKLIST
[y ] I have read the issue reporting guidelines
[y ] I confirm this is a suspected bug or issue that will affect other users
[y ] I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
[ y] I have read the documentation thoroughly and it does not help solve my issue.
[y ] I have checked that no similar issues (open or closed) already exist.
Current behavior:
Location Auth status is DENIED_ALWAYS when the option to "ask everytime" is selected on android. This is after the location has been requested once.
I realize this has been documented that there is no way for the plugin to distinguish between android "NOT_REQUESTED" and "DENIED_ALWAYS" statuses. Is there any work around so I can detect the "NOT_REQUESTED" status even after the user has been asked for permission once?
Expected behavior:
There should be a way to decipher between "NOT_REQUESTED" and "DENIED_ALWAYS"
Steps to reproduce:
Using the "cordova-diagnostic-plugin-example" app
Environment information
Thanks a lot for this plugin and for the help! :)
The text was updated successfully, but these errors were encountered: