You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2018/12/16 11:20:07 UTC

[cordova-plugin-camera] branch master updated: GH-376 (ios) fixes UIImagePickerController cancel handling for iOS11+ (#377)

This is an automated email from the ASF dual-hosted git repository.

jcesarmobile pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-camera.git


The following commit(s) were added to refs/heads/master by this push:
     new 24c8b6c  GH-376 (ios) fixes UIImagePickerController cancel handling for iOS11+ (#377)
24c8b6c is described below

commit 24c8b6c43dd986c3197017823b750d1368c9ff9b
Author: pz <ea...@users.noreply.github.com>
AuthorDate: Sun Dec 16 11:20:01 2018 +0000

    GH-376 (ios) fixes UIImagePickerController cancel handling for iOS11+ (#377)
---
 src/ios/CDVCamera.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index aae4247..bf02ca2 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -568,7 +568,7 @@ static NSString* toBase64(NSData* data) {
         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"];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org