From e2b32d04f057abe7d749f3ae8ae352df1b8674a1 Mon Sep 17 00:00:00 2001 From: VladiMihaylenko Date: Tue, 1 Dec 2015 14:36:17 +0300 Subject: [PATCH] [ios] Added location tracking in background. --- iphone/Maps/MAPSME.plist | 57 +++++++++++++------------ iphone/Maps/Platform/LocationManager.mm | 4 ++ 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/iphone/Maps/MAPSME.plist b/iphone/Maps/MAPSME.plist index 59c33410e2..d09e31d732 100644 --- a/iphone/Maps/MAPSME.plist +++ b/iphone/Maps/MAPSME.plist @@ -2,33 +2,6 @@ - UIApplicationShortcutItems - - - UIApplicationShortcutItemType - me.maps.3daction.search - UIApplicationShortcutItemTitle - search - UIApplicationShortcutItemIconFile - ic_3dtouch_search - - - UIApplicationShortcutItemType - me.maps.3daction.bookmarks - UIApplicationShortcutItemTitle - bookmarks - UIApplicationShortcutItemIconFile - ic_3dtouch_bookmarks - - - UIApplicationShortcutItemType - me.maps.3daction.route - UIApplicationShortcutItemTitle - route - UIApplicationShortcutItemIconFile - ic_3dtouch_planing_route - - CFBundleDevelopmentRegion en CFBundleDisplayName @@ -131,10 +104,38 @@ NSLocationAlwaysUsageDescription + UIApplicationShortcutItems + + + UIApplicationShortcutItemIconFile + ic_3dtouch_search + UIApplicationShortcutItemTitle + search + UIApplicationShortcutItemType + me.maps.3daction.search + + + UIApplicationShortcutItemIconFile + ic_3dtouch_bookmarks + UIApplicationShortcutItemTitle + bookmarks + UIApplicationShortcutItemType + me.maps.3daction.bookmarks + + + UIApplicationShortcutItemIconFile + ic_3dtouch_planing_route + UIApplicationShortcutItemTitle + route + UIApplicationShortcutItemType + me.maps.3daction.route + + UIBackgroundModes - remote-notification fetch + location + remote-notification UIFileSharingEnabled diff --git a/iphone/Maps/Platform/LocationManager.mm b/iphone/Maps/Platform/LocationManager.mm index e2b291bc7a..09fe8db43e 100644 --- a/iphone/Maps/Platform/LocationManager.mm +++ b/iphone/Maps/Platform/LocationManager.mm @@ -1,3 +1,4 @@ +#import "Common.h" #import "LocationManager.h" #import "MapsAppDelegate.h" #import "MapViewController.h" @@ -23,6 +24,9 @@ static NSString * const kAlohalyticsLocationRequestAlwaysFailed = @"$locationAlw m_locationManager.delegate = self; [UIDevice currentDevice].batteryMonitoringEnabled = YES; [self refreshAccuracy]; + if (!isIOSVersionLessThan(9)) + m_locationManager.allowsBackgroundLocationUpdates = YES; + m_locationManager.pausesLocationUpdatesAutomatically = YES; m_locationManager.headingFilter = 3.0; // m_locationManager.distanceFilter = 3.0; m_isStarted = NO;