1

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:

  1. user denies with "never ask again" checked
  2. I get a permission denied
  3. I check on shouldShowRequestPermissionRationale, I find it false and I know that it was permanently denied, I save it to cache.
  4. I want to ask for the permission again.
  5. I read from cache that I can't do it.
  6. show a popup to redirect to settings.
  7. user enables + disables the same permission.
  8. user goes back to the app.
  9. 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

TootsieRockNRoll
  • 3,218
  • 2
  • 25
  • 50
  • have you checked this [SO](https://stackoverflow.com/questions/50639292/detecting-wether-a-permission-can-be-requested-or-is-permanently-denied/50639402#50639402) ? – Sagar Jun 01 '18 at 10:14

0 Answers0