AI-generated Key Takeaways
-
GMTDDeliveryVehicleReporteris an object used to send delivery-related information to the Fleet Engine backend. -
The
setVehicleStopsmethod updates the remaining vehicle stops, requiring a non-nil, ordered array ofGMTDVehicleStopobjects, with all stops after the first one having a state ofGMTDVehicleStopStateNew. -
Methods
reportEnrouteToNextStopWithCompletion,reportArrivedAtStopWithCompletion, andreportCompletedStopWithCompletionupdate the state or remove the firstGMTDVehicleStopinremainingVehicleStops, which must contain at least one stop when these are called. -
getRemainingVehicleStopsWithCompletionretrieves theGMTDVehicleStopobjects that represent the vehicle's pending stops.
GMTDDeliveryVehicleReporter
@interface GMTDDeliveryVehicleReporter : GMTDVehicleReporterObject 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
vehicleStopsThe ordered array of
GMTDVehicleStopobjects the vehicle will visit. This must be non-nil and all stops other than the first stop must have a state ofGMTDVehicleStopStateNew.completionA block to run after the stops have been updated.
-
Updates the state of the first
GMTDVehicleStopinremainingVehicleStopstoGMTDVehicleStopStateEnroute.remainingVehicleStopsmust 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
completionA block to run after the stops have been updated.
-
Updates the state of the first
GMTDVehicleStopinremainingVehicleStopstoGMTDVehicleStopStateArrived.remainingVehicleStopsmust 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
completionA block to run after the stops have been updated.
-
Removes the first
GMTDVehicleStopinremainingVehicleStops.remainingVehicleStopsmust 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
completionA block to run after the stops have been updated.
-
Gets the remaining
GMTDVehicleStopobjects that the vehicle still needs to visit.Declaration
Swift
func remainingVehicleStops() async throws -> [GMTDVehicleStop]Objective-C
- (void)getRemainingVehicleStopsWithCompletion: (nonnull GMTDVehicleReporterStopCompletionHandler)completion;Parameters
completionA completion to run with the retrieved
GMTDVehicleStopobjects. The completion will be run asynchronously on the main thread.