0

I am new to ios and writing an application which uses GPS. This application works even in background. The problem I am facing here is, after device(ios) reboot my application which is in background doesn't receive any GPS updates. (I need to relaunch the app on device for it to receive gps updates)

Can any one suggest me how to overcome this issue?

Thanks,

Mamatha
  • 53
  • 1
  • 6

2 Answers2

1

For this you need to use startMonitoringSignificantLocationChanges when app goes to background.

- (void)applicationDidEnterBackground:(UIApplication *)application
{

    [self.locationManager startMonitoringSignificantLocationChanges];

}

Now when you device rebooted and whenever there is any location updates available ( as per the crieterion of SignificantLocationChanges) your app automatically invoke from background and app runs is background.

Bhumeshwer katre
  • 4,671
  • 2
  • 19
  • 29
0

You should use startMonitoringSignificantLocationChanges of CLLocationManager class. As per the apple documentation, even if system kills your application, it will invoke your application again when your device moves significantly.

Apurv
  • 17,116
  • 8
  • 51
  • 67