Skip to content

Commit

Permalink
Disable showing of location calibration on iOS
Browse files Browse the repository at this point in the history
In some devices, the location calibration is shown every time you request the current location.
  • Loading branch information
rohitvipin authored Jun 3, 2019
1 parent aac1677 commit 96986d0
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(() =>
{
Expand All @@ -57,7 +65,6 @@ public GeolocationSingleUpdateDelegate(CLLocationManager manager, double desired

public Task<Position> 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.
Expand All @@ -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__
Expand Down Expand Up @@ -169,4 +179,4 @@ private void StopListening()
manager.StopUpdatingLocation();
}
}
}
}

0 comments on commit 96986d0

Please sign in to comment.