Skip to content
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

UIImagePickerController cancel handling incorrect for iOS11+ #376

Closed
easywasdev opened this issue Nov 16, 2018 · 2 comments
Closed

UIImagePickerController cancel handling incorrect for iOS11+ #376

easywasdev opened this issue Nov 16, 2018 · 2 comments

Comments

@easywasdev
Copy link
Contributor

easywasdev commented Nov 16, 2018

The way the plugin handles the user cancelling the UIImagePickerController is not correct for iOS11+. From iOS 11 Apple no longer requires the user's explicit permission to show UIImagePickerController:

Accessing images using UIImagePickerViewController no longer requires explicit permission, though accessing the photo library through other APIs does. The changes to the photo library permission model is detailed in the WWDC17 sessions What's New in Photos and Privacy and Your Apps.

From https://forums.developer.apple.com/thread/86974#271938
See https://developer.apple.com/videos/play/wwdc2017-505/?time=252

Currently, imagePickerControllerDidCancel returns an error ("has no access to assets") if picker.sourceType != UIImagePickerControllerSourceTypeCamera && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized. In iOS11+ this will never be true. [ALAssetsLibrary authorizationStatus] returns ALAuthorizationStatusNotDetermined because permission is never requested. So returning the permission denied error is incorrect. The code remains correct from iOS 10 and below.

I will submit a pull request with a suggested solution to this problem either later today or Monday.

@easywasdev
Copy link
Contributor Author

CDVCameraLibTests do not run in Xcode 10, but worked in Xcode 9. I will submit the PR shortly

@jcesarmobile
Copy link
Member

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants