CB-11376: (ios): fix CameraUsesGeolocation error
If it's not a camera picture don't use geolocation
This closes #226
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 @@
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 {