GoogleRidesharingConsumer Framework Reference

GMTCTripModelSubscriber

@protocol GMTCTripModelSubscriber <NSObject>

A subscriber protocol for GMTCTripModel’s event update.

  • Called when the trip session state has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdate sessionState: GMTCTripModelState)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateModelState:(enum GMTCTripModelState)sessionState;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    sessionState

    The new session state.

  • Called when the current trip has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdate trip: GMTSTrip?, updatedPropertyFields: GMTSTripPropertyFields)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
                didUpdateTrip:(nullable GMTSTrip *)trip
        updatedPropertyFields:(GMTSTripPropertyFields)updatedPropertyFields;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    trip

    The trip that has changed.

    updatedPropertyFields

    The updated properties.

  • Called when the current trip status has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdate tripStatus: GMTSTripStatus)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateTripStatus:(enum GMTSTripStatus)tripStatus;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    tripStatus

    The updated trip status.

  • Called when the vehicle’s location has been updated. The new location may not be different from the previous one.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdate vehicleLocation: GMTSVehicleLocation?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateVehicleLocation:(nullable GMTSVehicleLocation *)vehicleLocation;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    vehicleLocation

    The last known vehicle location of the current trip.

  • Called when the pickup location has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdatePickupLocation pickupLocation: GMTSTerminalLocation?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdatePickupLocation:(nullable GMTSTerminalLocation *)pickupLocation;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    pickupLocation

    The current pickup location. This could be nil if the trip was reset or cancelled.

  • Called when the dropoff location has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateDropoffLocation dropoffLocation: GMTSTerminalLocation?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateDropoffLocation:(nullable GMTSTerminalLocation *)dropoffLocation;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    dropoffLocation

    The current dropoff location. This could be nil if the trip was reset or cancelled.

  • Called when the ETA to the next waypoint is updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateETAToNextWaypoint nextWaypointETA: TimeInterval)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateETAToNextWaypoint:(NSTimeInterval)nextWaypointETA;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    nextWaypointETA

    The driver’s current ETA to the pickup point. This could be 0 if the trip was reset or cancelled.

  • Called when the driver’s ETA to the pickup point is updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdatePickupETA pickupETA: TimeInterval)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdatePickupETA:(NSTimeInterval)pickupETA;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    pickupETA

    The driver’s current ETA to the pickup point. This could be 0 if the trip was either reset or cancelled.

  • Called when the driver’s ETA to the dropoff point is updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateDropoffETA dropoffETA: TimeInterval)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateDropoffETA:(NSTimeInterval)dropoffETA;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    dropoffETA

    The driver’s current ETA to the drop-off point. This could be 0 if the trip was either reset or cancelled.

  • Called when the remaining distance of the trip’s active route has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateActiveRouteRemainingDistance activeRouteRemainingDistance: Int32)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateActiveRouteRemainingDistance:(int32_t)activeRouteRemainingDistance;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    activeRouteRemainingDistance

    Distance in meters that remains on the active route between the current location of the vehicle and the next significant location. The next significant location depends on the status of the current trip. If the trip status is GMTSTripStatusEnrouteToPickup, this is the distance to the pickup location. If the trip status is GMTSTripStatusEnrouteToDropoff, this is the distance to the drop off location. Your app must provide any necessary measurement conversions.

  • Called when the active route segment of the trip has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateActiveRoute activeRoute: [GMTSLatLng]?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateActiveRoute:(nullable NSArray<GMTSLatLng *> *)activeRoute;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    activeRoute

    The active route segment of the current trip. This segment includes the route from the current location of the vehicle to the next significant location. If the trip status is GMTSTripStatusEnrouteToPickup, the next significant location is the pickup location. If the trip status is GMTSTripStatusEnrouteToDropoff, the next significant location is the drop off location.

  • Called when the remaining route segment of the trip has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemainingRoute remainingRoute: [GMTSLatLng]?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateRemainingRoute:(nullable NSArray<GMTSLatLng *> *)remainingRoute;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    remainingRoute

    The remaining route segment of the current trip. This segment includes the route from the current user’s next destination to the user’s final destination. If the trip status is GMTSTripStatusEnrouteToPickup, the remaining route segment will be the segment from the pickup location to the drop-off location.

  • Called when the distance of the trip’s remaining route has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemainingRouteDistance remainingRouteDistance: Int32)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateRemainingRouteDistance:(int32_t)remainingRouteDistance;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    remainingRouteDistance

    Distance in meters of the remaining route between the current user’s next destination to their final destination. The next destination depends on the status of the current trip. If the trip status is GMTSTripStatusEnrouteToPickup, the next destination is the drop-off location. Your app must provide any necessary measurement conversions.

  • Called when the trip’s intermediate waypoints have been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemaining remainingWaypoints: [GMTSTripWaypoint]?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateRemainingWaypoints:
            (nullable NSArray<GMTSTripWaypoint *> *)remainingWaypoints;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    remainingWaypoints

    The current remaining waypoints.

  • Called when the trip’s waypoints have been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateIntermediateDestinations intermediateDestinations: [GMTSTerminalLocation]?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateIntermediateDestinations:
            (nullable NSArray<GMTSTerminalLocation *> *)intermediateDestinations;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    intermediateDestinations

    The current remaining intermediate waypoints for this trip.

  • Called when traffic data has been updated for the active route segment of the trip.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateActiveRouteTraffic activeRouteTraffic: GMTSTrafficData?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateActiveRouteTraffic:(nullable GMTSTrafficData *)activeRouteTraffic;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    activeRouteTraffic

    The active route traffic segment of the current trip. This segment includes the route from the current location of the vehicle to the next significant location. If the trip status is GMTSTripStatusEnrouteToPickup, the next significant location is the pickup location. If the trip status is GMTSTripStatusEnrouteToDropoff, the next significant location is the drop off location.

  • Called when traffic data has been updated for the remaining route segment of the trip.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemainingRouteTraffic remainingRouteTraffic: GMTSTrafficData?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didUpdateRemainingRouteTraffic:
            (nullable GMTSTrafficData *)remainingRouteTraffic;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    remainingRouteTraffic

    The traffic data for the remaining route segment of the current trip.

  • Called when the trip monitoring request error has been updated.

    Declaration

    Swift

    optional func tripModel(_ tripModel: GMTCTripModel, didFailUpdateTripWithError error: (any Error)?)

    Objective-C

    - (void)tripModel:(nonnull GMTCTripModel *)tripModel
        didFailUpdateTripWithError:(nullable NSError *)error;

    Parameters

    tripModel

    The instance of GMTCTripModel that generated the event.

    error

    The error of the current trip monitoring request. The value could be nil.