How can I disable location information in PHPickerViewController?

76 Views Asked by At

I'm using PHPickerViewController to allow a user to import photos into my app. Unfortunately, it seems to default to including location information (see screenshot below, all the way at the bottom). I'm not interested at all in the photo's location information, and it makes it seem like my app has specifically requested location info, when I definitely have not.

I don't see this disclaimer in other apps, but I'm not sure how to replicate that behavior.

Can I use PHPickerViewController but specify in advance that location information should be excluded?

Here's my setup code:

    // N.B. I also tried the zero-argument constructor PHPickerConfiguration()
    var config = PHPickerConfiguration(photoLibrary: .shared())

    config.filter = .images
    config.selectionLimit = 0
    config.selection = .ordered
    
    let picker = PHPickerViewController(configuration: config)
    picker.delegate = self
    
    vc.present(picker, animated: true)

enter image description here

1

There are 1 best solutions below

1
On

Unfortunately there is no way to pre-populate the options for the photo picker and it seems to default to location on. This seems like an odd choice given Apple's typical privacy-first approach.

Once the user turns off location access for your app it will remain off unless they turn it back on, either in the photo picker or the device privacy settings.

I would encourage you to submit a feedback to Apple regarding this; They could either change the default or allow apps to provide default options.