In Swift 4.1 how do you request write-only permission for the photo library?

I have my app requesting permission to add to the photo library but I don't need read access. I see that there is supposed to be an option for this but I can't find how to ask for this access specifically.

I am doing this:

PHPhotoLibrary.requestAuthorization({status in
    if(status == .authorized){
        // save

And that works fine, but the request displayed is for full access.

Can I specify that I only need write access? I have both Privacy keys set up in my info.plist

I am running this on a simulator, ios 11.4

1 answer

  • answered 2018-08-09 01:04 Schemetrical

    Unfortunately, access control for PhotoKit is not separated between read and write. If you look at PHAuthorizationStatus, there are only cases where full access is granted. No write only option.

    NSPhotoLibraryUsageDescription is the only privacy message you can configure, so you can let the user know that you are only writing, not reading. App store review will make sure that is true.