GMTDDeliveryVehicleReporter Class Reference

GMTDDeliveryVehicleReporter Class Reference

Overview

Object for sending information to the Fleet Engine backend.

Used for deliveries.

Inherits GMTDVehicleReporter.

Public Member Functions

(void) - setVehicleStops:completion:
 Updates the remaining VehicleStops for the vehicle.
(void) - reportEnrouteToNextStopWithCompletion:
 Updates the state of the first GMTDVehicleStop in remainingVehicleStops to GMTDVehicleStopStateEnroute.
(void) - reportArrivedAtStopWithCompletion:
 Updates the state of the first GMTDVehicleStop in remainingVehicleStops to GMTDVehicleStopStateArrived.
(void) - reportCompletedStopWithCompletion:
 Removes the first GMTDVehicleStop in remainingVehicleStops.
(void) - getRemainingVehicleStopsWithCompletion:
 Gets the remaining GMTDVehicleStop objects that the vehicle still needs to visit.
(void) - updateVehicleState:
 Updates the vehicle state.
(void) - addListener:
 Adds a listener.
(void) - removeListener:
 Removes a listener.

Protected Types

typedef void(^ GMTDVehicleReporterStopCompletionHandler )(NSArray< GMTDVehicleStop * > *_Nullable stops, NSError *_Nullable error)
 Handler for updating stops via the GMTDDeliveryVehicleReporter.

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) setVehicleStops: (NSArray< GMTDVehicleStop * > *)  vehicleStops
completion: (GMTDVehicleReporterStopCompletionHandler completion 

Updates the remaining VehicleStops for the vehicle.

Results are reflected asynchronously in remainingVehicleStops. The vehicle is expected to visit the stops in the same order as the array.

Parameters:
vehicleStopsThe ordered array of GMTDVehicleStop objects the vehicle will visit. This must be non-nil and all stops other than the first stop must have a state of GMTDVehicleStopStateNew.
completionA block to run after the stops have been updated.

Updates the state of the first GMTDVehicleStop in remainingVehicleStops to GMTDVehicleStopStateEnroute.

remainingVehicleStops must contain at least one stop when this function is called.

Parameters:
completionA block to run after the stops have been updated.

Updates the state of the first GMTDVehicleStop in remainingVehicleStops to GMTDVehicleStopStateArrived.

remainingVehicleStops must contain at least one stop when this function is called.

Parameters:
completionA block to run after the stops have been updated.

Removes the first GMTDVehicleStop in remainingVehicleStops.

remainingVehicleStops must contain at least one stop when this function is called.

Parameters:
completionA block to run after the stops have been updated.

Gets the remaining GMTDVehicleStop objects that the vehicle still needs to visit.

Parameters:
completionA completion to run with the retrieved GMTDVehicleStop objects. The completion will be run asynchronously on the main thread.
- (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:
vehicleStateThe desired vehicle state.
- (void) addListener: (id< GMTDVehicleReporterListener >)  listener

Adds a listener.

The listener is held with a weak reference.

Parameters:
listenerAn object conforming to the GMTDVehicleReporterListener protocol.
- (void) removeListener: (id< GMTDVehicleReporterListener >)  listener

Removes a listener.

Parameters:
listenerAn object conforming to the GMTDVehicleReporterListener protocol.

Member Data Documentation

- GMTDVehicleReporter: [protected, inherited]

Property Documentation

- (GMSRoadSnappedLocationProviderListener BOOL) locationTrackingEnabled [read, write, assign, inherited]

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, inherited]

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.