zoontek / react-native-permissions

An unified permissions API for React Native on iOS, Android and Windows.
MIT License
4.1k stars 836 forks source link

Disabling alert asking for "always" permission #777

Closed siemya closed 1 year ago

siemya commented 1 year ago

Why it is needed?

My app needs background location, but in some conditions and screens, it doesn't.

In one of that cases, when I request location with LOCATION_WHEN_IN_USE, I see this location modal ;

Screenshot 2023-05-29 at 17 52 35

When I press "Allow While Using The App" now I get;

Screenshot 2023-05-29 at 17 55 41


Which actually I don't need it in this case at all since It is unnecessary for the user to give background location on this screen. But I know that it appears because the background location is enabled on my app.

I am not sure if it is possible but mainly I want to be able to disable the second modal programmatically if that is possible.

Possible implementation

No response

Code sample

No response

zoontek commented 1 year ago

Sorry that's not possible, that's how iOS is handling location permissions requests: https://developer.apple.com/documentation/corelocation/requesting_authorization_to_use_location_services