diff --git a/src/Geolocator.Plugin/Apple/GeolocationSingleUpdateDelegate.apple.cs b/src/Geolocator.Plugin/Apple/GeolocationSingleUpdateDelegate.apple.cs index a2b58c9..361cbf9 100644 --- a/src/Geolocator.Plugin/Apple/GeolocationSingleUpdateDelegate.apple.cs +++ b/src/Geolocator.Plugin/Apple/GeolocationSingleUpdateDelegate.apple.cs @@ -47,6 +47,14 @@ public GeolocationSingleUpdateDelegate(CLLocationManager manager, double desired t.Dispose(); }, null, timeout, 0); } + +#if __IOS__ + manager.ShouldDisplayHeadingCalibration += (CLLocationManager locationManager) => + { + locationManager.DismissHeadingCalibrationDisplay(); + return false; + }; +#endif cancelToken.Register(() => { @@ -57,7 +65,6 @@ public GeolocationSingleUpdateDelegate(CLLocationManager manager, double desired public Task Task => tcs?.Task; - public override void AuthorizationChanged(CLLocationManager manager, CLAuthorizationStatus status) { // If user has services disabled, we're just going to throw an exception for consistency. @@ -83,9 +90,12 @@ public override void Failed(CLLocationManager manager, NSError error) } } - #if __IOS__ - public override bool ShouldDisplayHeadingCalibration(CLLocationManager manager) => false; + public override bool ShouldDisplayHeadingCalibration(CLLocationManager locationManager) + { + locationManager.DismissHeadingCalibrationDisplay(); + return false; + } #endif #if __TVOS__ @@ -169,4 +179,4 @@ private void StopListening() manager.StopUpdatingLocation(); } } -} \ No newline at end of file +}