subscribeForLocationUpdates abstract method

void subscribeForLocationUpdates(
  1. LocationFilteringMode filteringMode,
  2. LocationPurpose purpose,
  3. LocationListener locationListener, {
  4. required double desiredAccuracy,
  5. required int minTime,
  6. required double minDistance,
  7. required bool allowUseInBackground,
})

Subscribe for location update events. If the listener was already subscribed to updates from the LocationManager, subscription settings will be updated. Use desiredAccuracy = 0 to obtain best possible accuracy, minTime = 0 to ignore minTime and use minDistance instead, minDistance = 0 to use only minTime. If both minTime and minDistance are set to zero, the subscription will use the same settings as other LocationManager clients.

The class does not retain the object in the 'locationListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

desiredAccuracy Desired location accuracy, in meters. This value is used to configure location services provided by the host OS. If locations with the desired accuracy are not available, updates may be called with lower accuracy. minTime Minimal time interval between events, in milliseconds. minDistance Minimal distance between location updates, in meters. allowUseInBackground Defines whether the subscription can continue to fetch notifications when the application is inactive. If allowUseInBackground is true, set the location flag in UIBackgroundModes for your application. filteringMode Defines whether locations should be filtered. purpose Defines whether locations will be used for navigation. locationListener Location update listener.

Implementation

void subscribeForLocationUpdates(
  LocationFilteringMode filteringMode,
  LocationPurpose purpose,
  mapkit_location_location_listener.LocationListener locationListener, {
  required core.double desiredAccuracy,
  required core.int minTime,
  required core.double minDistance,
  required core.bool allowUseInBackground,
});