Hello ! Regarding android permissions since Andro...
# android
l
Hello ! Regarding android permissions since Android 6 users can decide to denied and check "never ask again" for a permission you asked. This is even more relevant with Android 11, which is the solution by default when user deny your permission. I saw on some apps, that they are able to ask for a permission and if it's denied (at runtime or even before the app is started) they open the settings app, and the user can enable the permission from there. I haven't seen any official documentation for this specific behaviour. How do they detect the permission has been fully denied (prompt can't be shown again) ? Thanks !
stackoverflow 3
l
Usually it's done by requesting the permission, getting
PERMISSION_DENIED
then calling
.shouldShowRequestPermissionRationale()
which will tell you if it is acceptable for you to tell the user why the permission is needed. Note that method will return
false
if you have never requested the permission - you have to have requested it and it been denied before it will return
true
.
2
l
oh thanks, I saw the API
shouldShowRequestPermissionRationale
on the official documentation but it wasn't clear that it will return
true
if the permission was already asked.