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

always supply NSLocationWhenInUseUsageDescription string in expo #2719

Closed
wants to merge 1 commit into from
Closed

Conversation

bruno-centanaro
Copy link

@bruno-centanaro bruno-centanaro commented Apr 5, 2024

What

After upgrading to react-native-vision-camera 4.0.0-beta.12 and uploading a build to the app store connect I received the following warning:

ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “*.app” bundle should contain a NSLocationWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources.

But I don't use the location at all

Changes

This PR removes the need of the user to explicitly mention they use location to supply a default NSLocationWhenInUseUsageDescription string

Tested on

Related issues

Copy link

vercel bot commented Apr 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2024 2:17pm

@bruno-centanaro bruno-centanaro changed the title always supply NSLocationWhenInUseUsageDescription string always supply NSLocationWhenInUseUsageDescription string in expo Apr 5, 2024
@mrousavy
Copy link
Owner

mrousavy commented Apr 9, 2024

Hm, maybe we should make this even more optional. We don't want everybody to add location string to their app, do we? Does this do any harm?

@fobos531
Copy link
Contributor

Hm, maybe we should make this even more optional. We don't want everybody to add location string to their app, do we? Does this do any harm?

I would say it depends on whether VisionCamera by default stores location EXIF data for each picture that is taken. If the answer is yes, I would say that in that case supplying this string is in fact mandatory.

There was a similar issue in iOS (unrelated to VisionCamera) where viewing very specific images which contain EXIF data about contacts triggered a crash if the NSContacts usage description string was not provided in Info.plist. Probably in such cases iOS tries to request the contacts description in order to check if it can match up the contact data in the image with the information in the user's contacts app. In that sense, I would say the motivation behind the "need" for this string would be similar.

@mrousavy
Copy link
Owner

I think there's also a way to conditionally compile-out the location usage, I can look at that in a sec - can you help me with testing thoughg?

@mrousavy
Copy link
Owner

Are you on the Margelo Community Discord? Please ping me over there in the vision camera channel

@rwichmann
Copy link

I have this problem too and I think it would be great when this could be conditionally compiled out!

@rwichmann
Copy link

Hm, maybe we should make this even more optional. We don't want everybody to add location string to their app, do we? Does this do any harm?

I think an app should use as few permissions as possible. So it could do harm if the Apple Review Team doesn't like your app when you're app seems to use location services, but in reality it doesn't. If the review team is fine with it, I think it won't affect the app negative, however it might confuses other team members and it doesn't feel very clean.

@mrousavy
Copy link
Owner

See #2751

@mrousavy
Copy link
Owner

btw., is it enoughh to just compile out the CLLocationManager.requestAccess method, or do I also need to compile out stuff like CLLocationManager even though this code can never be reached?

Would be great if you could test that, as the first is pretty easy to do while the latter can be a bit hard to test.

@bruno-centanaro
Copy link
Author

Hello! Sorry I've been away, I was we a lot of stuff at work. On the weekend i can test that with no problem!

@mrousavy
Copy link
Owner

This has been fixed in #2751 and will be released in the next beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants