Skip to content

Commit 24c8b6c

Browse files
easywasdevjcesarmobile
authored andcommitted
GH-376 (ios) fixes UIImagePickerController cancel handling for iOS11+ (#377)
1 parent 7ddb3df commit 24c8b6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ios/CDVCamera.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ - (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker
568568
CDVPluginResult* result;
569569
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera && [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] != ALAuthorizationStatusAuthorized) {
570570
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"];
571-
} else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
571+
} else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && ! IsAtLeastiOSVersion(@"11.0") && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
572572
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to assets"];
573573
} else {
574574
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No Image Selected"];

0 commit comments

Comments
 (0)