Class YMKLocationManager

Handles location updates and changes.

Instance Methods

- requestSingleUpdateWithLocationListener:

Subscribe for a single location update.

- resume

Resumes updates stopped by call to the suspend method.

- subscribeForLocationUpdatesWithDesiredAccuracy:minTime:minDistance:allowUseInBackground:locationListener:

Subscribe for location update events.

- suspend

Stops updates for all subscriptions until resume is called.

- unsubscribeWithLocationListener:

Unsubscribe from location update events.

- requestSingleUpdateWithLocationListener:

Subscribe for a single location update.

- resume

Resumes updates stopped by call to the suspend method.

- subscribeForLocationUpdatesWithDesiredAccuracy:minTime:minDistance:allowUseInBackground:locationListener:

Subscribe for location update events.

- suspend

Stops updates for all subscriptions until resume is called.

- unsubscribeWithLocationListener:

Unsubscribe from location update events.

Class Methods

Method Detail

+lastKnownLocation

+ (YMKLocation *)lastKnownLocation

-requestSingleUpdateWithLocationListener:

- (void)requestSingleUpdateWithLocationListener:(nullable id< YMKLocationDelegate >)locationListener 

Subscribe for a single location update.

If the listener was already subscribed for location updates, previous subscription will be removed.
Parameters:
locationListener

Location update listener.

locationListener

Location update listener.

-resume

- (void)resume

Resumes updates stopped by call to the suspend method.

-subscribeForLocationUpdatesWithDesiredAccuracy:minTime:minDistance:allowUseInBackground:locationListener:

- (void)subscribeForLocationUpdatesWithDesiredAccuracy:(double)desiredAccuracy
                                               minTime:(long long)minTime
                                           minDistance:(double)minDistance
                                  allowUseInBackground:(BOOL)allowUseInBackground
                                      locationListener:(nullable id< YMKLocationDelegate >)locationListener 

Subscribe for location update events.

If listener was already subscribed for 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, subscription will use the same settings as other LocationManager clients.
Parameters:
desiredAccuracy

Desired location accuracy, in meters. This value is used to configure location services provided by host os. If locations with 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 if subscription can continue to fetch notifications when the application is inactive. If allowUseInBackground is true, set the location flag in UIBackgroundModes for your application.

locationListener

Location update listener.

desiredAccuracy

Desired location accuracy, in meters. This value is used to configure location services provided by host os. If locations with 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 if subscription can continue to fetch notifications when the application is inactive. If allowUseInBackground is true, set the location flag in UIBackgroundModes for your application.

locationListener

Location update listener.

-suspend

- (void)suspend

Stops updates for all subscriptions until resume is called.

-unsubscribeWithLocationListener:

- (void)unsubscribeWithLocationListener:(nullable id< YMKLocationDelegate >)locationListener 

Unsubscribe from location update events.

Can be called for either subscribeForLocationUpdates() or requestSingleUpdate(). In case of requestSingleUpdate(), if event was already received, unsubscribe() does not have any effect. If the listener is already unsubscribed, method call is ignored.
Parameters:
locationListener

Listener passed to either subscribeForLocationUpdates() or requestSingleUpdate().

locationListener

Listener passed to either subscribeForLocationUpdates() or requestSingleUpdate().