CB-7461 - Geolocation fails in Camera plugin in iOS 8

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/fa30a567
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/fa30a567
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/fa30a567

Branch: refs/heads/master
Commit: fa30a5676028f1240dfd979067fd5110814d055d
Parents: 5c13940
Author: Shazron Abdullah <shaz...@apache.org>
Authored: Wed Sep 3 16:48:42 2014 -0700
Committer: Anis Kadri <a...@apache.org>
Committed: Fri Sep 5 11:08:15 2014 -0700

----------------------------------------------------------------------
 plugin.xml          | 5 +++++
 src/ios/CDVCamera.m | 3 +++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/fa30a567/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index c660813..c9276e5 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -143,6 +143,11 @@
          <framework src="AssetsLibrary.framework" />
          <framework src="MobileCoreServices.framework" />
          <framework src="CoreGraphics.framework" />
+         
+         <config-file target="*-Info.plist" 
parent="NSLocationWhenInUseUsageDescription">
+             <string></string>
+         </config-file>
+                  
      </platform>
 
     <!-- blackberry10 -->

http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/fa30a567/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index fc1afb4..ac20c39 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -315,6 +315,9 @@ static NSSet* org_apache_cordova_validArrowDirections;
                     NSMutableDictionary *EXIFDictionary = [[controllerMetadata 
objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];
                     if (EXIFDictionary)        [self.metadata 
setObject:EXIFDictionary forKey:(NSString *)kCGImagePropertyExifDictionary];
                     
+                    if (IsAtLeastiOSVersion(@"8.0")) {
+                        [[self locationManager] 
performSelector:NSSelectorFromString(@"requestWhenInUseAuthorization") 
withObject:nil afterDelay:0];
+                    }
                     [[self locationManager] startUpdatingLocation];
                     return;
                 }

Reply via email to