NMAFleetConnectivityService
Class Summary
class NMAFleetConnectivityService
Derived from: NSObject
Main component of Fleet Connectivity Extension responsible for communication.
Include: NMAKit.framework/headers/NMAFleetConnectivityService.h
[For complete information, see the section Class Details]
Public Property Summary
Public Properties |
---|
[readable, writable, assign] Asset ID that identifies this device |
[readable, writable, weak] The NMAFleetConnectivityServiceDelegate that listens for messages from the NMAFleetConnectivityService |
[readable, writable, assign] Dispatcher ID that identifies the user of this device |
[readable, writable, assign] Polling interval specified in seconds |
Instance Method Summary
Instance Method Summary |
---|
Forces poll of new events, if the service is running |
Do not directly instantiate an instance of this class |
Retrieves the ID of currently running job |
Dispatches the provided event |
Starts the service if it is not already started |
Stops the service if it is running |
Class Method Summary
Class Methods |
---|
|
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< 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. 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
Returns the NMAFleetConnectivityService singleton instance.
Use this method to obtain a NMAFleetConnectivityService instance. Do not call init directly.
This method returns a nil object if access to this operation is denied. Contact your HERE representative for more information.
Returns:
shared NMAFleetConnectivityService instance