Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes (and how can I fix) this odd Core Location error?

ERROR,Generic,Time,320195751.128,Function,"void CLClientHandleRegistrationTimerExpiry(__CFRunLoopTimer*, void*)",Registration timer expired, but client is still registering!

There are only a few mentions of this problem that I was able to dig up in the wider Internet, and nobody has useful info. Here's the context:

I have an app that monitors the device's location via CLLocationManager's startUpdatingLocation method. It starts monitoring, runs for a little while, then this message pops up in the debug output. From that point forward, no more location updates are delivered.

This error is killing the location functionality of the app, and I'm at a loss as to what may be causing it. It even has an exclamation point at the end, which means it's clearly an exciting error.

Update:
Though I never found a solution to the problem, or figured out why it happens in the first place, I've also lost the ability to reproduce it. This seems to have happened during some period of time in which I did many things, including a general change in code structure followed by update to the iOS 5 beta. Something there seems to have silenced the issue for me.

like image 692
Matt Wilding Avatar asked Feb 23 '11 23:02

Matt Wilding


2 Answers

Have you implemented

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error 

and does this catch it?

You need to check for kCLErrorNetwork, kCLErrorDenied, kCLErrorHeadingFailure and kCLErrorLocationUnknown in the normal run of things but I'm wondering if there are other errors that the delegate can still catch?

This could give you the opportunity to stop and then restart location services.

like image 184
Roger Avatar answered Sep 23 '22 06:09

Roger


Going off of what @schillace had to share, is it possible that you're attempting to force location updates without heeding the user's authorization status?

Try to hold off on calling -startUpdatingLocation until you know that [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized.

like image 33
Mark Adams Avatar answered Sep 23 '22 06:09

Mark Adams