Я хочу сохранить изображения в рулоне камеры ios. Он хорошо работает в симуляторе.iOS Разрешение на доступ к фотографиям, не работающим на устройстве
но на фактическом iPhone я не получаю разрешение запрос так:
- (void)saveImageToCameraRoll:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* pluginResult = nil;
NSString *filename = [command argumentAtIndex:0];
NSString *tmpFile = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", filename]];
UIImage *image = nil;
image = [UIImage imageWithContentsOfFile:tmpFile];
ALAuthorizationStatus status = [ALAssetsLibrary authorizationStatus];
if(status != ALAuthorizationStatusAuthorized || image == nil){
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"noaccess"];
}
else{
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"saved"];
}
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
есть ли способ, чтобы заставить его?
Спасибо. Приветствия.