Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone compass interference detection

How can I tell from my app if the compass has interference and ask the user to re-calibrate it?

I want to get the same behavior as the google maps app has when there are compass interferences.

Thanks.

like image 766
Nir Levy Avatar asked Dec 13 '22 00:12

Nir Levy


1 Answers

Implement the CLLocationManagerDelegate method to return a true value

-(BOOL)locationManagerShouldDisplayHeadingCalibration : (CLLocationManager *)manager {

    //do stuff

    return YES;
}

This will tell the LocationManager to perform recalibration if interference is detected after notifying you of the event.

If you need to dismiss the overlay for some reason before it is removed automatically then call

- (void)dismissHeadingCalibrationDisplay
like image 60
Kevin Avatar answered Jan 09 '23 17:01

Kevin