mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-31 12:42:50 +08:00
CB-6576 - Returns a specific error message when app has no access to library.
Signed-off-by: Shazron Abdullah <shazron@apache.org>
This commit is contained in:
parent
e8596fbc8e
commit
0c9de56da5
@ -24,6 +24,7 @@
|
|||||||
#import <Cordova/NSDictionary+Extensions.h>
|
#import <Cordova/NSDictionary+Extensions.h>
|
||||||
#import <ImageIO/CGImageProperties.h>
|
#import <ImageIO/CGImageProperties.h>
|
||||||
#import <AssetsLibrary/ALAssetRepresentation.h>
|
#import <AssetsLibrary/ALAssetRepresentation.h>
|
||||||
|
#import <AssetsLibrary/AssetsLibrary.h>
|
||||||
#import <ImageIO/CGImageSource.h>
|
#import <ImageIO/CGImageSource.h>
|
||||||
#import <ImageIO/CGImageProperties.h>
|
#import <ImageIO/CGImageProperties.h>
|
||||||
#import <ImageIO/CGImageDestination.h>
|
#import <ImageIO/CGImageDestination.h>
|
||||||
@ -392,7 +393,13 @@ static NSSet* org_apache_cordova_validArrowDirections;
|
|||||||
}
|
}
|
||||||
// popoverControllerDidDismissPopover:(id)popoverController is called if popover is cancelled
|
// 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.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId];
|
||||||
|
|
||||||
self.hasPendingOperation = NO;
|
self.hasPendingOperation = NO;
|
||||||
|
Loading…
Reference in New Issue
Block a user