iphone compass interference detection
-
19-09-2019 - |
Question
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.
Solution
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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow