diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 9981747..8c11e60 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -24,6 +24,7 @@ #import #import #import +#import #import #import #import @@ -392,7 +393,13 @@ static NSSet* org_apache_cordova_validArrowDirections; } // popoverControllerDidDismissPopover:(id)popoverController is called if popover is cancelled - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no image selected"]; // error callback expects string ATM + CDVPluginResult* result; + if ([ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized) { + result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no image selected"]; // error callback expects string ATM + } else { + result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to assets"]; // error callback expects string ATM + } + [self.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId]; self.hasPendingOperation = NO;