1

I have checked both of the following:

  • Background Modes - Location updates
  • requestWhenInUseAuthorization (also tried always on)

The location services works fine when the app is in the foreground however when the phone is in sleep or pressing the home button causes it to stop.

I have also noticed that the blue banner '%MyApp% is Using Your Location' is not showing either

I am using iOS9 beta 2 and Xcode 7 beta 2

Rob McMorran
  • 165
  • 1
  • 7
  • In your `Info.plist` file, do you have `NSLocationAlwaysUsageDescription` included in your Information Property List? You might find this helpful. http://matthewfecher.com/app-developement/getting-gps-location-using-core-location-in-ios-8-vs-ios-7/ – Adrian Jun 24 '15 at 20:04

1 Answers1

5

It appears this was an iOS9 issue. A further couple lines of code are required:

if([self.locationManager respondsToSelector:@selector(allowsBackgroundLocationUpdates)]){
        [self.locationManager setAllowsBackgroundLocationUpdates:YES];
    }
Rob McMorran
  • 165
  • 1
  • 7