react-native-permissions
react-native-permissions copied to clipboard
How to request specific iOS location info. (Always and When in Use)
Describe your environment
- React-Native version: 0.57
- Platform: iOS
- Device Xcode Simulator
- OS version: 12.1
- react-native-permissions version: 1.1.1
- Devtools: Xcode
How to repeat the issue and example
I've been trying to find a way to request for iOS location permissions as Always and When in Use. Right now, both of them return authorized.
Solution
I'm wondering if there's a way to get this info natively and bring it with this library.
I'm using beacons in my App so I need the user to accept the "location > always" permission but I get "authorized" even if the user only gave "when in use".
My code:
Permissions.request('location', 'always' )
.then(permissionStatus => {
console.log('⭐️ Permissions.request location', permissionStatus);
( ... )
the output after the user gave "when in use":
'⭐️ Permissions.request location', 'authorized'
I am closing this since this issue does not exists anymore with the 2.0.0 release.