Search code examples
react-nativegeolocationauthorizationlocation

In a react-native iOS app, can you request location authorization more than once?


The react-native app (iOS version) that I am building requires location authorization for its central functionality. If I call "Geolocation.requestAuthorization" and the user denies authorization, can I tell them that it is required and ask again? If so, how? I have tried to do this and the iOS location permission popup does not appear.


Solution

  • In a React Native iOS app, you get one shot to ask for location authorization. Just one. If your user decides to pass on that, they'll need to manually turn on location services for your app in the settings of their device. Apple's IOS lets you ask the user for a particular permission just once. If the user says no, any future attempts by your app to request that same permission will be shot down instantly. Your app's permission callback will then get the lowdown on the user's current authorization status.

    Given these rules, it's usually a good move to let users know why you need their location before popping the question. If they said no before but you need to ask again for another feature, you can explain why it's necessary and show them how to turn on location services in their device settings.