Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Background location tracking fails on test devices

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?

like image 948
Zoltan Varadi Avatar asked Jun 29 '15 15:06

Zoltan Varadi


1 Answers

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

like image 175
BKjadav Avatar answered Nov 15 '22 21:11

BKjadav