ILocationProvider
Geoposition source interface that the platform implements.
func setCallbacks(
locationCallback: LocationCallback?,
availabilityCallback: AvailabilityCallback?
)
Set the callback functions to update the current geoposition and change the availability of the geoposition source. Calling this method again overwrites the previously set callback functions. If both parameters are nil
, geoposition update tracking must be disabled.
locationCallback
LocationCallback?
Updates the current geoposition. If the provider is available ( calling availabilityCallback
returns true), this source always delivers a valid geoposition. A valid geoposition is a geoposition in which all fields have the current value at the time it was sent to this channel (i.e. if the accuracy of the geoposition >= half the length of the Earth's equator, the geoposition is valid for any of the correct coordinates specified in it). If the accuracy value <= 0, the position is considered unreliable even if isAvailable
== true. See the CLLocationManagerDelegate.locationManager(didUpdateLocations:)
method.
availabilityCallback
AvailabilityCallback?
Changes the availability of the geoposition source. If this function is called with the value true, all subsequent locationCallback
calls will contain a valid (up-to-date) geoposition. Even if tracking of geoposition changes is unavailable, the ILocationProvider
implementation may send a new geoposition, but it will be considered unreliable. See the CLLocationManagerDelegate.locationManager(didFailWithError:)
method.
func setDesiredAccuracy(_ accuracy: DesiredAccuracy)
Sets the desired accuracy of the positioning. If the device cannot return a location with the desired accuracy, it may return a location with a lower accuracy. If the platform does not provide a method with similar functionality, this method must have an empty implementation.
See the CLLocationManager.desiredAccuracy
method and \ .
accuracy