So, this is what I want to achieve:
user taps button A, if the permission is not in "never ask again" state, ask it directly:
-> if granted, perfect
-> if denied, do nothing, user taps again, and same thing reproduces. if "never ask again" was checked, then show a popup to redirect to settings.
now I know I can use the shouldShowRequestPermissionRationale
when it is denied. but here's my problem:
- user denies with "never ask again" checked
- I get a permission denied
- I check on shouldShowRequestPermissionRationale, I find it
false
and I know that it was permanently denied, I save it to cache. - I want to ask for the permission again.
- I read from cache that I can't do it.
- show a popup to redirect to settings.
- user enables + disables the same permission.
- user goes back to the app.
- I want to ask for the permission again.
BOOM: if I rely on the cache, I would think the permission is permanently disabled, whereas if I directly ask for it, the system will show the permission popup with "deny" "accept".
How can I go around that, and more importantly, why is there nothing on the public API to know without any headache if a certain permission is in "never ask again" mode.
Thank you all