GoogleRidesharingDriver Framework Reference

GMTDVehicleReporterListener

@protocol GMTDVehicleReporterListener <NSObject>

Protocol for responding to periodic vehicle updates sent by GMTDVehicleReporter.

  • Informs the listeners that the Fleet Engine backend successfully received the vehicle location and state update.

    Declaration

    Swift

    func vehicleReporter(_ vehicleReporter: GMTDVehicleReporter, didSucceed vehicleUpdate: GMTDVehicleUpdate)

    Objective-C

    - (void)vehicleReporter:(nonnull GMTDVehicleReporter *)vehicleReporter
        didSucceedVehicleUpdate:(nonnull GMTDVehicleUpdate *)vehicleUpdate;

    Parameters

    vehicleReporter

    Indicates the instance of GMTDVehicleReporter that generated the event.

    vehicleUpdate

    Contains the current location and state of the vehicle.

  • Informs the listeners that a vehicle update failed. As long as location tracking is enabled, GMTDVehicleReporter continues to send the latest data to the Fleet Engine backend.

    If location tracking is disabled and this is for updating the vehicle state to OFFLINE, the developer can call -updateVehicleState: with GMTDVehicleStateOffline to trigger one-off updates.

    Declaration

    Swift

    func vehicleReporter(_ vehicleReporter: GMTDVehicleReporter, didFail vehicleUpdate: GMTDVehicleUpdate, withError error: any Error)

    Objective-C

    - (void)vehicleReporter:(nonnull GMTDVehicleReporter *)vehicleReporter
        didFailVehicleUpdate:(nonnull GMTDVehicleUpdate *)vehicleUpdate
                   withError:(nonnull NSError *)error;

    Parameters

    vehicleReporter

    Indicates the instance of GMTDVehicleReporter that generated the event.

    vehicleUpdate

    Contains the current location and state of the vehicle.

    error

    Indicates the reason that an error occurred.