I'm trying to disable the compass calibration screen from appearing in iOS within my Xamarin.Forms application. I've found the following Xamarin.iOS API method needed to disable the screen programatically:
I am having trouble figuring out exactly how to call it from my Xamarin Forms application.
Here is a C# code snippet of how I'm calling it from a view model in my Xamarin.Forms MVVM application:
#if __IOS__
var locationManager = new CoreLocation.CLLocationManager();
locationManager.RequestWhenInUseAuthorization(); // only when in foreground
//locationManager.RequestAlwaysAuthorization();// always
locationManager.ShouldDisplayHeadingCalibration += (CoreLocation.CLLocationManager manager) => {return false;};
#endif
Unfortunately this coding solution doesn't work as I'm still seeing the compass calibration screen within my application.
I'm assuming I need to get a reference to the existing core location manager and assign this delegate override there instead of instantiating a new one on every request to load my view model but can't find how to do that in any of the documentation or coding examples.
Any help is greatly appreciated.