GMTDDeliveryVehicleReporter
@interface GMTDDeliveryVehicleReporter : GMTDVehicleReporter
Object for sending information to the Fleet Engine backend. Used for deliveries.
-
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.Declaration
Swift
func setVehicleStops(_ vehicleStops: [GMTDVehicleStop]) async throws -> [GMTDVehicleStop]
Objective-C
- (void)setVehicleStops:(nonnull NSArray<GMTDVehicleStop *> *)vehicleStops completion: (nonnull GMTDVehicleReporterStopCompletionHandler)completion;
Parameters
vehicleStops
The 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 ofGMTDVehicleStopStateNew
.completion
A block to run after the stops have been updated.
-
Updates the state of the first
GMTDVehicleStop
inremainingVehicleStops
toGMTDVehicleStopStateEnroute
.remainingVehicleStops
must contain at least one stop when this function is called.Declaration
Swift
func reportEnrouteToNextStop() async throws -> [GMTDVehicleStop]
Objective-C
- (void)reportEnrouteToNextStopWithCompletion: (nonnull GMTDVehicleReporterStopCompletionHandler)completion;
Parameters
completion
A block to run after the stops have been updated.
-
Updates the state of the first
GMTDVehicleStop
inremainingVehicleStops
toGMTDVehicleStopStateArrived
.remainingVehicleStops
must contain at least one stop when this function is called.Declaration
Swift
func reportArrivedAtStop() async throws -> [GMTDVehicleStop]
Objective-C
- (void)reportArrivedAtStopWithCompletion: (nonnull GMTDVehicleReporterStopCompletionHandler)completion;
Parameters
completion
A block to run after the stops have been updated.
-
Removes the first
GMTDVehicleStop
inremainingVehicleStops
.remainingVehicleStops
must contain at least one stop when this function is called.Declaration
Swift
func reportCompletedStop() async throws -> [GMTDVehicleStop]
Objective-C
- (void)reportCompletedStopWithCompletion: (nonnull GMTDVehicleReporterStopCompletionHandler)completion;
Parameters
completion
A block to run after the stops have been updated.
-
Gets the remaining
GMTDVehicleStop
objects that the vehicle still needs to visit.Declaration
Swift
func remainingVehicleStops() async throws -> [GMTDVehicleStop]
Objective-C
- (void)getRemainingVehicleStopsWithCompletion: (nonnull GMTDVehicleReporterStopCompletionHandler)completion;
Parameters
completion
A completion to run with the retrieved
GMTDVehicleStop
objects. The completion will be run asynchronously on the main thread.