Closed DaliaElhefny closed 7 months ago
ACCESS_FINE_LOCATION
should be required with ACCESS_COARSE_LOCATION
(using requestMultiple
): https://developer.android.com/develop/sensors-and-location/location/permissions#approximate-request
@zoontek but this issue also happens with READ_PHONE_STATE
permission
To clarify my issue more: When requesting a permission and then choose Don't Allow
option, the returned result is 'blocked' but when call check()
to get the status it returns denied
from what I understand denied
status means that it is requestable but it is not
Also try this steps on the above code to undrstand the conflict more:
Ask every time
denied
Request location permission
button, the OS alert will appear then choose Don't Allow
and check your terminal for logs you can search with location permission request result in your terminal, you'll find the logged result is denied
(which means that it is requestable)Request location permission
button again, the OS alert will appear then choose Don't Allow
again and check your terminal for logs you'll find the logged result is blocked
(which means that it is not requestable)denied
(the output of check()
function) which means that it should be requestableRequest location permission
button again, no OS alert appears and check your terminal for logs you'll find the logged result is blocked
(which means that it is not requestable) which is logical but the check()
function doesn't reflect thisThese steps show that request()
and check()
return different statuses for the permission and that I can't rely on check()
to know the correct status of the permission
To clarify my issue more: When requesting a permission and then choose Don't Allow option, the returned result is 'blocked' but when call check() to get the status it returns denied from what I understand denied status means that it is requestable but it is not
Ah yes, way more clear! This is 100% normal on Android (check the flow)
It's impossible on Android to know if a permission is blocked before requesting it. That's also why check
on PermissionsAndroid
can only resolves a boolean
- but request
can resolve a PermissionStatus
Duplicate: https://github.com/zoontek/react-native-permissions/issues/828#issuecomment-1842456998
Before submitting a new issue
Bug summary
I'm requesting location permission in my app
ACCESS_FINE_LOCATION
and faced unexpected behavior When requesting the location permission the OS alert appears and then I selectDon't allow
optionExpected:
check()
function to get permission status it should returnblocked
in this case, or maybe returndenied
but should display the OS alert to request the permission againActual:
check()
function to get permission status it always returnsdenied
and never asks for the permission againLibrary version
4.1.5
Environment info
Steps to reproduce
Don't Allow
optiondenied
, the OS alert won't be displayed again)Reproducible sample code