Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master 7e8fe0bae -> c13e9f327


CB-11376: (ios): fix CameraUsesGeolocation error

If it's not a camera picture don't use geolocation

 This closes #226


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/c13e9f32
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/c13e9f32
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/c13e9f32

Branch: refs/heads/master
Commit: c13e9f327b1f2a8d3cc96c3ae20c403dea2b0c97
Parents: 7e8fe0b
Author: Julio César <jcesarmob...@gmail.com>
Authored: Sun Jul 31 20:15:49 2016 +0200
Committer: Julio César <jcesarmob...@gmail.com>
Committed: Tue Aug 2 00:16:38 2016 +0200

----------------------------------------------------------------------
 src/ios/CDVCamera.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/c13e9f32/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index f2b17f4..019141b 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -524,9 +524,11 @@ static NSString* toBase64(NSData* data) {
         NSString* mediaType = [info 
objectForKey:UIImagePickerControllerMediaType];
         if ([mediaType isEqualToString:(NSString*)kUTTypeImage]) {
             [weakSelf resultForImage:cameraPicker.pictureOptions info:info 
completion:^(CDVPluginResult* res) {
-                [weakSelf.commandDelegate sendPluginResult:res 
callbackId:cameraPicker.callbackId];
-                weakSelf.hasPendingOperation = NO;
-                weakSelf.pickerController = nil;
+                if (![self usesGeolocation] || picker.sourceType != 
UIImagePickerControllerSourceTypeCamera) {
+                    [weakSelf.commandDelegate sendPluginResult:res 
callbackId:cameraPicker.callbackId];
+                    weakSelf.hasPendingOperation = NO;
+                    weakSelf.pickerController = nil;
+                }
             }];
         }
         else {


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

Reply via email to