Thank you very much for this library. In my app, I only need to access location in foreground so I only add "NSLocationWhenInUseUsageDescription" in my Info.plist file but Apple requires to also add "NSLocationAlwaysUsageDescription".
Message from Apple: Missing Purpose String in Info.plist File - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data.
An other RN location library had the same issue and chose to give the ability to configure authorization level : https://github.com/react-native-community/react-native-geolocation/pull/26
Note : If I try to add NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription in Info.plist file, the authorization popup doesn't appear anymore.
Is there a way to fix this issue ? Thank you very much for your help !
Thanks for the link, I'll look into it.
I ran into this issue as well. After adding NSLocationAlwaysUsageDescription I no longer received the permission. The only way to get it to trigger the dialog currently was to remove it from the info.plist file.
Since this library uses the default RN implementation for iOS and it's been moved to react-native-geolocation, we'll also move to use that library for iOS. But since I don't have any iOS device, I can't test it. So if you guys can test it and report back, that'll be great. I'll be updating the package within this week.
@Agontuk -
I am facing same issue with permission and rejection from iOS side. I don't want to use location always (background). I have googled and found, other libraries are adding configuration, where we can manage this.
https://github.com/react-native-community/react-native-geolocation/pull/26
Default issue with React
@tlupo @fostahgix @codoffer
I've pushed a commit in master branch to fix this, please try and let me know if it works. I'll then release it in npm registry.
@Agontuk I'm getting same ITMS-90683: Missing Purpose String in Info.plist about NSLocationAlwaysUsageDescription key, even after upgrading to "react-native-geolocation-service": "^3.0.0",. I don't think I have any other location related package installed.
I tried 3.0.0 in RN 0.60 and it's working fine for me. Can you please follow the instruction again, I've updated the README for 0.60.
I'll close this, feel free to comment if issue persists.
@Agontuk well maybe then that's my issue, because I've not yet upgraded to 0.60 and maybe these triggers come from the RN bundled geolocation lib that comes with version prior 0.60.
3.0.0 works with RN 0.59 too. Can you check your info.plist and see if this key NSLocationAlwaysUsageDescription is actually not included there ?
NSLocationAlwaysUsageDescription wasn't included when the app got auto rejected by Apple, but after I included the key and a description, it got passed the auto check and it's now on AppStore! I can't understand though why Apple auto check triggers that false positive since I don't use any background geolocation services.
@clytras , you should try to set the autorization level to whenInUse like this
Geolocation.setRNConfiguration({ authorizationLevel : "whenInUse" });
This way you don't need to add NSLocationAlwaysUsageDescription in info.plist. Check if it works for you.
@Agontuk yes, that will most likely fix the case. I saw setRNConfiguration but I don't know why I haven't used it! Will confirm that it works when I'll send next version release to Apple. Thanks for your help.
Most helpful comment
Thanks for the link, I'll look into it.