I am running my code on iPhone 11 pro.
I granted permission "Select Photos" and PHAuthorizationStatus is .limited. Also selected some photos.
But when I again open the PHPickerViewController to select photos I get all the photos from my library instead of selected photos.
PHAccessLevel level = PHAccessLevelReadWrite;
status = [PHPhotoLibrary authorizationStatusForAccessLevel:level];
switch (status) {
case PHAuthorizationStatusLimited:
PHPickerConfiguration *config = [[PHPickerConfiguration alloc] initWithPhotoLibrary:[PHPhotoLibrary sharedPhotoLibrary]];
config.filter = [PHPickerFilter imagesFilter];
//Unlimited selection by specifying "0"
config.selectionLimit = 0;
PHPickerViewController *pickerViewController = [[PHPickerViewController alloc] initWithConfiguration:config];
pickerViewController.delegate = self;
[self presentViewController:pickerViewController animated:YES completion:nil];
break;
case PHAuthorizationStatusNotDetermined:
[PHPhotoLibrary requestAuthorizationForAccessLevel:(PHAccessLevelReadWrite) handler:^(PHAuthorizationStatus
newStatus) {
dispatch_async(dispatch_get_main_queue(), ^{
if (newStatus == PHAuthorizationStatusLimited){
//TODO
}
});
}];
}
Added following keys:
Info.plist
<key>NSCameraUsageDescription</key>
<key>PHPhotoLibraryPreventAutomaticLimitedAccessAlert</key>
Any solution for the above stated issue?
Post
Replies
Boosts
Views
Activity
I am also facing same problem. Any update about the solution?