Skip to content

Commit

Permalink
GH-376 (ios) fixes UIImagePickerController cancel handling for iOS11+ (
Browse files Browse the repository at this point in the history
  • Loading branch information
easywasdev authored and jcesarmobile committed Dec 16, 2018
1 parent 7ddb3df commit 24c8b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ios/CDVCamera.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down

0 comments on commit 24c8b6c

Please sign in to comment.