From 4a102cf40d7b8e55396579ca7c6bab91454120a4 Mon Sep 17 00:00:00 2001 From: "Thillaiganesh, C" Date: Tue, 1 Mar 2016 12:17:49 +0530 Subject: [PATCH] Fix for CB-10050 : Plugin Camera : Inconsistent saveToPhotoAlbum behavior on PHOTOLIBRARY images --- src/ios/CDVCamera.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 1fae2e29f..51b75d656 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -78,7 +78,12 @@ + (instancetype) createFromTakePictureArguments:(CDVInvokedUrlCommand*)command pictureOptions.mediaType = [[command argumentAtIndex:6 withDefault:@(MediaTypePicture)] unsignedIntegerValue]; pictureOptions.allowsEditing = [[command argumentAtIndex:7 withDefault:@(NO)] boolValue]; pictureOptions.correctOrientation = [[command argumentAtIndex:8 withDefault:@(NO)] boolValue]; - pictureOptions.saveToPhotoAlbum = [[command argumentAtIndex:9 withDefault:@(NO)] boolValue]; + if (pictureOptions.sourceType == UIImagePickerControllerSourceTypePhotoLibrary) { + pictureOptions.saveToPhotoAlbum = NO; + } + else { + pictureOptions.saveToPhotoAlbum = [[command argumentAtIndex:9 withDefault:@(NO)] boolValue]; + } pictureOptions.popoverOptions = [command argumentAtIndex:10 withDefault:nil]; pictureOptions.cameraDirection = [[command argumentAtIndex:11 withDefault:@(UIImagePickerControllerCameraDeviceRear)] unsignedIntegerValue];