Forum Xamarin.iOS

Strange CLLocationManager accuracy constant value

LeloLelo Member ✭✭✭
edited January 2020 in Xamarin.iOS

I have recently just finished my own service for fetching the location of the device on iOS - and I have encountered a strange value in the accuracy constants that can be set to the CLLocationManager instance. They are: https://developer.apple.com/documentation/corelocation/kcllocationaccuracybestfornavigation

According to the xamarin docs: https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/backgrounding/ios-backgrounding-walkthroughs/location-walkthrough
the value which is a double is in meters. So it can be set to one meter.
Xamarin Essentials uses these contants: https://github.com/xamarin/Essentials/blob/master/Xamarin.Essentials/Geolocation/GeolocationRequest.ios.cs

Using the best constant: AccurracyBestForNavigation - it prints out -2.
I found it a bit confusing. Is it an error or can the accuracy somehow be set to a negative amount of meters?

Best Answer

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    CLLocation.AccurracyBestForNavigation is a predefined property of CLLocation. It could have some special internal usage or special meaning. I haven't tried to print out its specific value and I think there's no need to.
    Normally, we consumed its property directly.

  • LeloLelo Member ✭✭✭

    Question is if I get better accuracy with 1 meter as proposed in the example in the Microsoft docs - or if I will getter better accuracy using the constant :/

Sign In or Register to comment.