zhangao0086 / DKImagePickerController

Image Picker Controller for iOS written in Swift 4 & 5.
MIT License
1.49k stars 471 forks source link

Why does DKImagePickerController requires user's location? #672

Open aamir-nazir opened 4 years ago

aamir-nazir commented 4 years ago

Recently I got my application rejected from AppStore on following reason: ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data

After spending some time I found that DKImagePickerController is using user's location which it didn't mention in documentation.

zhangao0086 commented 4 years ago

Hi @aamir-nazir Did you set the containsGPSInMetadata to true?

/// DKImagePickerController.swift

/// Photos will be tagged with the location where they are taken.
/// If true, your Info.plist should include the "Privacy - Location XXX" tag.
open var containsGPSInMetadata = false
aamir-nazir commented 4 years ago

No I didn't. It not even asking for location permission but Apple somehow detected this and rejected the application.

aamir-nazir commented 4 years ago

@zhangao0086 can you please explain.

zhangao0086 commented 4 years ago

Hi @aamir-nazir Sorry for the late reply :(

The picker integrated DKCamera to provide camera feature, then it will tag the image with the GPS coordinates of where the image was taken as part of that EXIF data: https://github.com/zhangao0086/DKCamera/blob/develop/DKCamera/DKCameraLocationManager.swift#L31

Then you can also notice that it will not be enabled if the containsGPSInMetadata is false (as default): https://github.com/zhangao0086/DKCamera/blob/develop/DKCamera/DKCamera.swift#L330

So the picker will not actually asking for location permission. I think, although the picker did not ask for location permission, Apple believes that the code has the ability to access locations then they rejected...

aamir-nazir commented 4 years ago

Yes Picker hasn't asked for the user location but still Apple has rejected the build. What do you think is the best way to deal with it when someone doesn't wants image tagging functionality?

zhangao0086 commented 4 years ago

I think there is no simple way to handle it in the code. So I'll point out it on the README.

prawnsalad commented 4 years ago

Hi @zhangao0086, thanks for the project so far! Is it feasible to produce a build option that doesn't include these location APIs? Perhaps mocked out or simply commented out or something.

We have an app that is used by privacy focused minds and the simple location permission is a dealbreaker for many just for an image picker.

ankit0812 commented 2 years ago

Any solution for this? I don't want to have that location permission in my app.