views:

451

answers:

1

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.

+7  A: 

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
Kevin