HERE iOS SDK Developer's Guide

NMAFleetConnectivityService

Class Summary

class NMAFleetConnectivityService

Derived from: NSObject

Main component of Fleet Connectivity Extension responsible for communication.

Include: NMAKit.framework/headers/NMAFleetConnectivityService.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAFleetConnectivityService

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, writable, assign] NSString *  assetId

Asset ID that identifies this device

[readable, writable, weak] id< NMAFleetConnectivityServiceDelegate delegate

The NMAFleetConnectivityServiceDelegate that listens for messages from the NMAFleetConnectivityService

[readable, writable, assign] NSString *  dispatcherId

Dispatcher ID that identifies the user of this device

[readable, writable, assign] NSUInteger  pollingInterval

Polling interval specified in seconds

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(BOOL) forcePoll

Forces poll of new events, if the service is running

-(nonnull instancetype) init

Do not directly instantiate an instance of this class

-(nullable NSString *) runningJobId

Retrieves the ID of currently running job

-(BOOL) sendEvent:(nonnull NMAFleetConnectivityEvent *) event

Dispatches the provided event

-(BOOL) start

Starts the service if it is not already started

-(BOOL) stop

Stops the service if it is running

Class Method Summary

Table 3. Class Methods
Class Methods

+(nonnull instancetype) new

+(nullable NMAFleetConnectivityService *) sharedFleetConnectivityService

Returns the NMAFleetConnectivityService singleton instance

Class Details

Main component of Fleet Connectivity Extension responsible for communication.

Public Property Details

[readable, writable, assign] NSString * assetId

Asset ID that identifies this device. Will be reported in every event dispatched to the server. Server provides new messages based on this ID. Service won't start if it is not specified.

[readable, writable, weak] id< NMAFleetConnectivityServiceDelegatedelegate

The NMAFleetConnectivityServiceDelegate that listens for messages from the NMAFleetConnectivityService.

[readable, writable, assign] NSString * dispatcherId

Dispatcher ID that identifies the user of this device. Service won't start if it is not specified.

[readable, writable, assign] NSUInteger pollingInterval

Polling interval specified in seconds. Default value is 10 seconds. Any attempt to set this property to 0 will be ignored and pollingInterval remains unchanged.

Instance Method Details

-(BOOL) forcePoll

Forces poll of new events, if the service is running.

Returns:

NO if service is not running.

-(nonnull instancetype) init

Do not directly instantiate an instance of this class.

-(nullable NSString *) runningJobId

Retrieves the ID of currently running job. Job is started by sending NMAFleetConnectivityJobStartedEvent. Job can be stopped by sending NMAFleetConnectivityJobFinishedEvent or NMAFleetConnectivityJobCancelledEvent.

Returns:

ID of the currently running job. Nil if no job is in progress.

-(BOOL) sendEvent:(nonnull NMAFleetConnectivityEvent *) event

Dispatches the provided event.

Parameters:

  • event

    The NMAFleetConnectivityEvent instance. See NMAFleetConnectivityJobStartedEvent, NMAFleetConnectivityJobFinishedEvent, NMAFleetConnectivityJobRejectedEvent, NMAFleetConnectivityJobCancelledEvent and NMAFleetConnectivityCustomEvent.

Returns:

NO if service is not running or conditions for given event are not met.

-(BOOL) start

Starts the service if it is not already started. Fails if assetId or dispatcherId is not set.

Returns:

NO if assetId or dispatcherId is not set or service is already started.

-(BOOL) stop

Stops the service if it is running.

Returns:

NO if service is not running.

Class Method Details

+(nonnull instancetype) new

Instances of this class should not be initialized directly

+(nullable NMAFleetConnectivityService *) sharedFleetConnectivityService

Returns the NMAFleetConnectivityService singleton instance.

Note:

Use this method to obtain a NMAFleetConnectivityService instance. Do not call init directly.

Note:

This method returns a nil object if access to this operation is denied. Contact your HERE representative for more information.

Returns:

shared NMAFleetConnectivityService instance