Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Purpose String in Info.plist File for NSLocationAlwaysUsageDescription #25

Closed
ravirajn22 opened this issue Apr 15, 2019 · 8 comments · Fixed by #26
Closed

Missing Purpose String in Info.plist File for NSLocationAlwaysUsageDescription #25

ravirajn22 opened this issue Apr 15, 2019 · 8 comments · Fixed by #26
Labels
bug Something isn't working released

Comments

@ravirajn22
Copy link

ravirajn22 commented Apr 15, 2019

Platforms

iOS

Versions

  • react-native: 0.58.4

Description

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.

We get the above warning email from Apple store. I use LocationWhenInUseUsageDescription but not NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationAlwaysUsageDescription. In other terms we want location data only when app is in the foreground not in background.

Things i tried

  • Added strings for both NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationAlwaysUsageDescription. But this library uses the always permission when the strings are present, but we don't want those permission.

What is the best way to handle this situation?

@ravirajn22 ravirajn22 added the bug Something isn't working label Apr 15, 2019
@matt-oakes
Copy link
Collaborator

Thanks for reporting this issue. This is something that is known about and there is an ongoing discussion about it here:

#12

For now, there are some alternative libraries in the README which handle the permissions differently. Alternatively, can you use react-native-permissions instead of the requestPermissions method in this library.

I'm going to close this in favour of the open issue mentioned above. Let me know if you have any other issues or comments.

@matt-oakes
Copy link
Collaborator

A PR to help with this issue has been opened here:

#26

@react-native-community-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@codoffer
Copy link

I am using below code (Location for application usage only, not required for background) but getting email from iOS submission about "Missing Purpose String in Info.plist File for NSLocationAlwaysUsageDescription"

Can you help me? How can I fix this?

Geolocation.setRNConfiguration({ skipPermissionRequests: false, authorizationLevel: 'whenInUse' });

@matt-oakes
Copy link
Collaborator

@codoffer Exactly as the message says, you need to add that key, along with a description of why you need location permission, to your Info.plist file

@codoffer
Copy link

@matt-oakes I am not using location in background. I am using location when app is active only. For this, I am using 'whenInUse' with setRNConfiguration.

Why am I getting email for NSLocationAlwaysUsageDescription?

@matt-oakes
Copy link
Collaborator

The library includes code for both "in use" and "always". Apple can't tell if your app is actually calling any of them. It requires that you add the usage strings for all location types. We should update the README to make this clear.

@RocKhalil
Copy link

@matt-oakes I know this is an old topic, however, Apple are currently rejecting some Apps if the use the NSLocationAlwaysUsageDescription.

Any solution for this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants