-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images not shown first time after getting permission iOS 14 #319
Comments
I am facing the same problem, did you find a solution? |
Does it work if you don't set a custom fetch result? |
Same problem faced here and I have not used any custom fetch results Getting - _BSMachError: port 6c03; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND" - in console |
Also getting this same problem |
and user thsi as
|
I solved this issue on my application by wrapping the function that presents the ImagePickerController in a wrapper function that asks the user for authorization prior to presenting the picker: PHPhotoLibrary.requestAuthorization { (auth_status) in
if auth_status == .denied || auth_status == .notDetermined {
/* User denied permission or left the authorization in an undetermined state
Enter code here to handle this event or leave it blank if you don't want to do anything
*/
} else {
/*
auth_status is either authorized, limited, or restricted. Call wrapper function
*/
self.FunctionThatPresentsImagePickerController()
}
} However in iOS 14 when the This solution is an anti-pattern and only really serves as a temporary solution until a fix is made. |
The issue was because of the authorisation status
The was the solution for my case as well. However instead of checking the status I manually asked for premission using the EG:
|
I'm using this library on iOS 14 and when I install my app the first time and allow permission to access all photos then there is no image in the picker.
after cancel when again press the upload button and I got all pictures.
this is my code to present the image picker.
let imagePicker = ImagePickerController() imagePicker.settings.fetch.assets.supportedMediaTypes = [.image] imagePicker.settings.selection.max = 5 imagePicker.settings.theme.selectionStyle = .numbered imagePicker.settings.selection.unselectOnReachingMax = false let options = imagePicker.settings.fetch.album.options imagePicker.settings.fetch.album.fetchResults = [ PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: options), PHAssetCollection.fetchAssetCollections(with: .album, subtype: .albumRegular, options: options), ]
The text was updated successfully, but these errors were encountered: