Reputation: 831
As per the quick read the purpose of this key "PHPhotoLibraryPreventAutomaticLimitedAccessAlert" is to prevent limited library access. I have added this option in info.plist but it still shows "Select photos" option in permissions dialogue.
The code of getting permissions is following.
func checkPhotoLibraryPermission(completionBlock completion: @escaping ()->Void) {
let status = PHPhotoLibrary.authorizationStatus()
switch status {
case .authorized:
completion()
break
case .notDetermined,.denied,.restricted:
// ask for permissions
PHPhotoLibrary.requestAuthorization { (status) in
switch status {
case .authorized:
completion()
break
case .notDetermined,.denied,.restricted:
self.alertToEncouragePhotoLibraryAccessWhenApplicationStarts()
break
case .limited:
break
}
}
break
case .limited:
break
}
}
Anyone please mention what is the exact purpose of this key and is it possible to even force drop this option ?
Upvotes: 1
Views: 1892
Reputation: 535890
As far as i know the purpose of this key "PHPhotoLibraryPreventAutomaticLimitedAccessAlert" is to prevent limited library access.
That's incorrect. You cannot prevent use of limited authorization. It is built into the system and the user can always specify it.
So what is this key for? Well, if the user does specify limited access, the system may put up the Select Photos interface again from time to time to see whether the user wants to change what photos your app can access. PHPhotoLibraryPreventAutomaticLimitedAccessAlert prevents that. It does not prevent the user from specifying limited access in the initial authorization request alert or the Settings app.
Upvotes: 5