From c13e9f327b1f2a8d3cc96c3ae20c403dea2b0c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar?= Date: Sun, 31 Jul 2016 20:15:49 +0200 Subject: [PATCH] CB-11376: (ios): fix CameraUsesGeolocation error If it's not a camera picture don't use geolocation This closes #226 --- src/ios/CDVCamera.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 {