Post

Replies

Boosts

Views

Activity

Reply to PhotoKit request AddOnly authorization error:Domain=com.apple.photos.error Code=46104
Seems to work in iOS 15, so this is what I'm doing now: requestAuthorization {   /// got permissions } func requestAuthorization(completion: @escaping (() -> Void)) {   if #available(iOS 15, *) { /// works, so use `addOnly`     PHPhotoLibrary.requestAuthorization(for: .addOnly) { (status) in       if status == .authorized || status == .limited {         completion()       }     }   } else if #available(iOS 14, *) { /// use `readWrite` directly instead. This will ask for both read and write access, but at least it doesn't crash...     PHPhotoLibrary.requestAuthorization(for: .readWrite) { (status) in       if status == .authorized || status == .limited {         completion()       }     }   } else { /// for older iOS just do `requestAuthorization`     PHPhotoLibrary.requestAuthorization { (status) in       if status == .authorized {         completion()       }     }   } }
Sep ’21