HERE iOS SDK Developer's Guide

<NMAPositionDataSource>

Protocol Summary

protocol <NMAPositionDataSource>

Derived from: <NSObject>

The interface used to create a custom position source for NMAPositioningManager.

Include: NMAKit.framework/headers/NMAPositionDataSource.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for <NMAPositionDataSource> – <NMAPositionDataSource>

[For complete information, see the section Protocol Details]

Instance Method Summary

Table 1. Instance Methods
Instance Method Summary

- @optional (BOOL) backgroundUpdatesEnabled

Returns whether or not position updates will continue when the app is sent to the background

-(nullable NMAGeoPosition *) currentPosition

Returns the latest position generated by the data source.

- @optional (void) navigationStartedWithTransportMode:( NMATransportMode ) transportMode

Notifies the data source that NMANavigationManager has started a navigation session

- @optional (void) navigationStopped

Notifies the data source that NMANavigationManager has stopped the navigation session

- @optional (void) setBackgroundUpdatesEnabled:(BOOL) enabled

Notifies the data source whether or not position updates should continue when the app is sent to the background

- @optional (void) start

Notifies the data source that position updates should start.

- @optional (void) stop

Notifies the data source that position updates should stop.

Protocol Details

The interface used to create a custom position source for NMAPositioningManager.

Custom position data sources are used in conjunction with NMAPositioningManager to provide position data to the application. To broadcast position updates, a source should created and installed on the NMAPositioningManager using its dataSource property. When a source has a new position available (or it determines the current postion is unknown because a position/GPS fix has been lost), it calls the dataSourceDidUpdatePosition: method of NMAPositioningManager. The positioning manager then uses the currentPosition method of the data source to retrieve the updated position.

Instance Method Details

- @optional (BOOL) backgroundUpdatesEnabled

Returns whether or not position updates will continue when the app is sent to the background.

Subclasses should implement this to reflect the state set by setBackgroundUpdatesEnabled: and should only return YES if position updates will continue in the background.

Note:

The position data source in use must support background updates in order to use positioning-dependent features such as navigation in the background.

See also:

NMANavigationManager::backgroundNavigationEnabled

-(nullable NMAGeoPosition *) currentPosition

Returns the latest position generated by the data source.

This method is used by the NMAPositioningManager to retrieve position updates.

Note:

If the the current postion is unknown because a position/GPS fix has been lost this method should return nil.

- @optional (void) navigationStartedWithTransportMode:( NMATransportMode ) transportMode

Notifies the data source that NMANavigationManager has started a navigation session.

The data source may wish to cache it's current settings and increase the frequency, quality or accuracy of the position updates whilst navigation is active.

- @optional (void) navigationStopped

Notifies the data source that NMANavigationManager has stopped the navigation session.

The data source may wish to reduce it's current settings (or restore previously cached settings) in order to preserve battery life when navigation is not active.

- @optional (void) setBackgroundUpdatesEnabled:(BOOL) enabled

Notifies the data source whether or not position updates should continue when the app is sent to the background.

Note:

The position data source in use must support background updates in order to use positioning-dependent features such as navigation in the background.

See also:

NMANavigationManager::backgroundNavigationEnabled

- @optional (void) start

Notifies the data source that position updates should start.

This message is sent by the NMAPositioningManager to indicate to the data source that positioning has been started. It will also be sent when a new data source is installed on the positioning manager while it is active.

- @optional (void) stop

Notifies the data source that position updates should stop.

This message is sent by the NMAPositioningManager to indicate to the data source that positioning has been stopped. It will also be sent to the data source when it is removed from the positioning manager if positioning is active.