react-native-permissions icon indicating copy to clipboard operation
react-native-permissions copied to clipboard

How to request specific iOS location info. (Always and When in Use)

Open Kevinclap opened this issue 8 years ago • 2 comments

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.

Kevinclap avatar Nov 26 '18 19:11 Kevinclap

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'

nunobasto avatar Jun 04 '19 13:06 nunobasto

I am closing this since this issue does not exists anymore with the 2.0.0 release.

zoontek avatar Sep 28 '19 12:09 zoontek