cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/2] cordova-plugin-geolocation git commit: CB-8826 Check for NSLocationWhenInUseUsageDescription first
Date Wed, 28 Oct 2015 19:40:51 GMT
Repository: cordova-plugin-geolocation
Updated Branches:
  refs/heads/master 3f0c06368 -> f9dd314b2


CB-8826 Check for NSLocationWhenInUseUsageDescription first


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

Branch: refs/heads/master
Commit: 8e7ff11b9a97e923c16eb1b8edbb4eeca9eabe13
Parents: 2397519
Author: Mihkel Sokk <mihkelsokk@gmail.com>
Authored: Wed Jul 22 22:16:43 2015 +0300
Committer: Mihkel Sokk <mihkelsokk@gmail.com>
Committed: Wed Jul 22 22:40:56 2015 +0300

----------------------------------------------------------------------
 src/ios/CDVLocation.m | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/8e7ff11b/src/ios/CDVLocation.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVLocation.m b/src/ios/CDVLocation.m
index 8b543c8..9284246 100644
--- a/src/ios/CDVLocation.m
+++ b/src/ios/CDVLocation.m
@@ -122,17 +122,17 @@
     NSUInteger code = [CLLocationManager authorizationStatus];
     if (code == kCLAuthorizationStatusNotDetermined && ([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]
|| [self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])) {
//iOS8+
         __highAccuracyEnabled = enableHighAccuracy;
-        if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysUsageDescription"]){
-            [self.locationManager requestAlwaysAuthorization];
-        } else if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"])
{
-            [self.locationManager  requestWhenInUseAuthorization];
+        if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"]){
+            [self.locationManager requestWhenInUseAuthorization];
+        } else if([[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysUsageDescription"])
{
+            [self.locationManager  requestAlwaysAuthorization];
         } else {
             NSLog(@"[Warning] No NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription
key is defined in the Info.plist file.");
         }
         return;
     }
 #endif
-    
+
     // Tell the location manager to start notifying us of location updates. We
     // first stop, and then start the updating to ensure we get at least one
     // update, even if our location did not change.


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


Mime
View raw message