Overview
Object for sending information to the Fleet Engine backend.
Use this class only from the main thread.
Public Member Functions | |
(void) | - updateVehicleState: |
Updates the vehicle state. | |
(void) | - addListener: |
Adds a listener. | |
(void) | - removeListener: |
Removes a listener. | |
Protected Attributes | |
__pad0__: NSObject <GMSNavigatorListener | |
Properties | |
GMSRoadSnappedLocationProviderListener BOOL | locationTrackingEnabled |
This class has no public initializers; obtain this object from the vehicleReporter property of the GMTDDeliveryDriverAPI or GMTDRidesharingDriverAPI object. | |
NSTimeInterval | locationReportingInterval |
Indicates the minimum interval at which location reports will be delivered to Fleet Engine. |
Member Function Documentation
- (void) updateVehicleState: | (GMTDVehicleState) | vehicleState |
Updates the vehicle state.
Used only for ridesharing.
If locationTrackingEnabled
is set to NO, setting the state to GMTDVehicleStateOnline
fails.
Setting a different state will send a one-off request to the Fleet Engine backend.
This method updates a server-side state, the client app should monitor fleetEngine:didSucceedVehicleUpdate:
and fleetEngine:didFailVehicleUpdate:withError:
to confirm success or failure. Failures are retried automatically if locationTrackingEnabled
is set to YES.
- Parameters:
-
vehicleState The desired vehicle state.
- (void) addListener: | (id< GMTDVehicleReporterListener >) | listener |
Adds a listener.
The listener is held with a weak reference.
- Parameters:
-
listener An object conforming to the GMTDVehicleReporterListener
protocol.
- (void) removeListener: | (id< GMTDVehicleReporterListener >) | listener |
Removes a listener.
- Parameters:
-
listener An object conforming to the GMTDVehicleReporterListener
protocol.
Member Data Documentation
- GMTDVehicleReporter: |
Property Documentation
- (GMSRoadSnappedLocationProviderListener BOOL) locationTrackingEnabled [read, write, assign] |
This class has no public initializers; obtain this object from the vehicleReporter
property of the GMTDDeliveryDriverAPI
or GMTDRidesharingDriverAPI
object.
Indicates whether location tracking is enabled.
If set to YES, trip and vehicle updates are sent to the Fleet Engine backend at a regular interval based on the value set for locationUpdateInterval
.
If set to NO, updates stop and a one-off vehicle update request is sent to the Fleet Engine backend to set the vehicle state to GMTDVehicleStateOffline
. See updateVehicleState
for special considerations on handling failures when locationTrackingEnabled
is set to NO.
- (NSTimeInterval) locationReportingInterval [read, write, assign] |
Indicates the minimum interval at which location reports will be delivered to Fleet Engine.
- Note:
- The default reporting interval is 10 seconds. The maximum supported value is 60 seconds and the minimum supported value is 5 seconds. If a value outside of this range is used, the requested value is clamped to that range.