Skip to content
Permalink
Browse files
GH-376 (ios) fixes UIImagePickerController cancel handling for iOS11+ (
  • Loading branch information
easywasdev authored and jcesarmobile committed Dec 16, 2018
1 parent 7ddb3df commit 24c8b6c43dd986c3197017823b750d1368c9ff9b
Showing 1 changed file with 1 addition and 1 deletion.
@@ -568,7 +568,7 @@ - (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker
CDVPluginResult* result;
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera && [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] != ALAuthorizationStatusAuthorized) {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"];
} else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
} else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && ! IsAtLeastiOSVersion(@"11.0") && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to assets"];
} else {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No Image Selected"];

0 comments on commit 24c8b6c

Please sign in to comment.