Iphone compass jam detection

How can I find out from my application if the compass has interference and ask the user to recalibrate it?

I want to get the same behavior as the google maps app when there is compass interference.

Thanks.

+4
source share
1 answer

Implement the CLLocationManagerDelegate method to return the true value.

-(BOOL)locationManagerShouldDisplayHeadingCalibration : (CLLocationManager *)manager { //do stuff return YES; } 

This will tell the LocationManager to recalibrate if interference is detected after notifying of this event.

If you need to fire the overlay for any reason, before it is deleted automatically, call

 - (void)dismissHeadingCalibrationDisplay 
+13
source

Source: https://habr.com/ru/post/1300991/


All Articles