Rufen Sie uns an: +49 30 23320715 E-Mail: sales@creativeworkline.com

Core Location Manager in iOS 8 and fetching location in the background

Posted Dezember 5th, 2014 in Blog by creative workline

In the first part of this post we will discuss the changes that come to the CoreLocation Framework in iOS 8, and in the second part we will go over how to keep updating the app’s location in the background. So let’s begin!

Core Location Manager in iOS 8

The Core Location Framework in iOS worked over the years in almost the same way, in some version updates Apple may have changed the delegate methods, but all in all the process always stayed the same. Although the process in iOS 8 is not that different, Apple added two steps that might at first cause some trouble to developers who didn’t have a look into the new iOS 8 SDK.

Old Code behavior in iOS 8


- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    // initialize the location manager
    self.locationManager = [[CLLocationManager alloc] init];
    self.locationManager.delegate = self;
    // Start getting location updates
    [self.locationManager startUpdatingLocation];

}

// Location updates
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
	// Do what ever you want with the location
}

Until iOS 8, this is how a simple location retrieving process would look like.
This code fails in iOS 8, furthermore this code fails without any sort of warnings, exceptions or errors, the app won’t ask for permission to get location updates, the process won’t start at all and we, the app developers won’t be told why. Continue Reading »

VN:F [1.9.22_1171]
Rating: 4.6/5 (12 votes cast)
Share:  
Mobile App Entwicklung und App Programmierung in Deutschland und Österreich. © App Agentur creative workline GmbH 2018
  Mobile App Solutions Software Produkt Entwicklung Software Erstellung Berlin Software Plattform Entwicklung App Entwicklung Berlin App Entwicklung Köln App Entwicklung München App Entwicklung Frankfurt App Entwicklung Hamburg App Entwicklung Hannover App Entwicklung Bremen App Entwicklung Düsseldorf App Entwicklung Deutschland App Entwicklung Berlin App Entwicklung Deutschland In Berlin App erstellen lassen
  App Programmierung Berlin App Programmierung Köln App Programmierung München App Programmierung Hamburg App Programmierung Hannover App Programmierung Bremen App Programmierung Deutschland App Programmierung Berlin App Programmierung Deutschland