Based on this example application and this Stackoverflow post: Periodic iOS background location updates, I have managed to create a working implementation for periodic background location tracking.
Everything works well on the device and I install the application from Xcode, but to every tester I send the application to via crashlytics the app still times out in the background.
Does it have to do anything with debug/release mode or provisioning profiles?
You have to use applicationDidEnterBackground method to get update location in background mode. I have download your source from github, in this there is no implemented in below method :
- (void)applicationDidEnterBackground:(UIApplication *)application
{
}
You have to use like this :
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[self.shareModel.anotherLocationManager stopMonitoringSignificantLocationChanges];
if(IS_OS_8_OR_LATER) {
[self.shareModel.anotherLocationManager requestAlwaysAuthorization];
}
[self.shareModel.anotherLocationManager startMonitoringSignificantLocationChanges];
}
For more details you can refer the link : http://mobileoop.com/getting-location-updates-for-ios-7-and-8-when-the-app-is-killedterminatedsuspended
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With