Reputation: 24563
For iOS 8 I have added the following key to my plist:
NSLocationAlwaysUsageDescription
I also added:
// Check for iOS 8
if ([_locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
[_locationManager requestAlwaysAuthorization];
}
I deleted the app from my phone. Upon launch I get prompted if its ok to run location services in background as expected. I click yes. While the app is running I get locations and the location active icon is in the status bar.
However if I leave the app the location active icon soon disappears from the status bar and I no longer get locations.
Do I need to re setup the location manager when the app enters the background? Does the location manager property/variable need to be defined in the AppDelegate such that it never goes away?
Upvotes: 0
Views: 87
Reputation: 10221
You also have to set location updates in the background modes of your capabilities.
Upvotes: 2