I am trying to record a users location over time. If the user is on the move it works fine and the delegate method didUpdateToLocation is invoked reliably.However if the user is stationary and the app is running in the background then after some time, the delegate method is no longer invoked. To restart it, the app needs to be bought into the foreground. Once it is active the delegate method is invoked reliably again.
I initially thought that this could be due to the fact that the CLLocationManager object was declared within a ViewController, so I changed it to be declared within the AppDelegate but that did not help either.
I have also experimented with the distanceFilter property to no avail. I am currently setting it up using the following code from within a View controller. Note that the object itself is declared and initialized in the AppDelegate object.
app.locationManager.delegate = self;
app.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
app.locationManager.distanceFilter = kCLDistanceFilterNone;
[app.locationManager startUpdatingLocation];
Has anyone else run into this issue? Any pointers would be appreciated. I have been struggling with this for a few days now.