AI-generated Key Takeaways
- 
          The GMTCTripModelSubscriberprotocol allows for subscribing to updates related to aGMTCTripModelinstance, enabling real-time monitoring of various trip-related events.
- 
          Subscribers can receive updates on the trip session state, changes to the trip's properties, and the current trip status. 
- 
          Updates are provided on the vehicle's location, as well as pickup and dropoff locations, giving subscribers comprehensive spatial information. 
- 
          Subscribers are informed about changes to estimated times of arrival (ETA) for pickup and dropoff, as well as the ETA to the next waypoint, and are notified of changes to the distance of the active route and remaining route. 
- 
          The protocol provides updates on the route data, including the active and remaining route segments, along with traffic data and intermediate waypoints, and also notifies subscribers of errors with the trip monitoring request. 
GMTCTripModelSubscriber
@protocol GMTCTripModelSubscriber <NSObject>A subscriber protocol for GMTCTripModel’s event update.
- 
                  
                  Called when the trip session state has been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdate sessionState: GMTCTripModelState)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateModelState:(enum GMTCTripModelState)sessionState;ParameterstripModelThe instance of GMTCTripModel that generated the event. sessionStateThe new session state. 
- 
                  
                  Called when the current trip has been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdate trip: GMTSTrip?, updatedPropertyFields: GMTSTripPropertyFields)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateTrip:(nullable GMTSTrip *)trip updatedPropertyFields:(GMTSTripPropertyFields)updatedPropertyFields;ParameterstripModelThe instance of GMTCTripModel that generated the event. tripThe trip that has changed. updatedPropertyFieldsThe updated properties. 
- 
                  
                  Called when the current trip status has been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdate tripStatus: GMTSTripStatus)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateTripStatus:(enum GMTSTripStatus)tripStatus;ParameterstripModelThe instance of GMTCTripModel that generated the event. tripStatusThe updated trip status. 
- 
                  
                  Called when the vehicle’s location has been updated. The new location may not be different from the previous one. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdate vehicleLocation: GMTSVehicleLocation?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateVehicleLocation:(nullable GMTSVehicleLocation *)vehicleLocation;ParameterstripModelThe instance of GMTCTripModel that generated the event. vehicleLocationThe last known vehicle location of the current trip. 
- 
                  
                  Called when the pickup location has been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdatePickupLocation pickupLocation: GMTSTerminalLocation?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdatePickupLocation:(nullable GMTSTerminalLocation *)pickupLocation;ParameterstripModelThe instance of GMTCTripModel that generated the event. pickupLocationThe current pickup location. This could be nil if the trip was reset or cancelled. 
- 
                  
                  Called when the dropoff location has been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateDropoffLocation dropoffLocation: GMTSTerminalLocation?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateDropoffLocation:(nullable GMTSTerminalLocation *)dropoffLocation;ParameterstripModelThe instance of GMTCTripModelthat generated the event.dropoffLocationThe current dropoff location. This could be nil if the trip was reset or cancelled. 
- 
                  
                  Called when the ETA to the next waypoint is updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateETAToNextWaypoint nextWaypointETA: TimeInterval)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateETAToNextWaypoint:(NSTimeInterval)nextWaypointETA;ParameterstripModelThe instance of GMTCTripModelthat generated the event.nextWaypointETAThe 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. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdatePickupETA pickupETA: TimeInterval)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdatePickupETA:(NSTimeInterval)pickupETA;ParameterstripModelThe instance of GMTCTripModelthat generated the event.pickupETAThe 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. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateDropoffETA dropoffETA: TimeInterval)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateDropoffETA:(NSTimeInterval)dropoffETA;ParameterstripModelThe instance of GMTCTripModelthat generated the event.dropoffETAThe 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. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateActiveRouteRemainingDistance activeRouteRemainingDistance: Int32)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateActiveRouteRemainingDistance:(int32_t)activeRouteRemainingDistance;ParameterstripModelThe instance of GMTCTripModelthat generated the event.activeRouteRemainingDistanceDistance 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 isGMTSTripStatusEnrouteToDropoff, 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. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateActiveRoute activeRoute: [GMTSLatLng]?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateActiveRoute:(nullable NSArray<GMTSLatLng *> *)activeRoute;ParameterstripModelThe instance of GMTCTripModelthat generated the event.activeRouteThe 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 isGMTSTripStatusEnrouteToDropoff, the next significant location is the drop off location.
- 
                  
                  Called when the remaining route segment of the trip has been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemainingRoute remainingRoute: [GMTSLatLng]?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateRemainingRoute:(nullable NSArray<GMTSLatLng *> *)remainingRoute;ParameterstripModelThe instance of GMTCTripModelthat generated the event.remainingRouteThe 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. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemainingRouteDistance remainingRouteDistance: Int32)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateRemainingRouteDistance:(int32_t)remainingRouteDistance;ParameterstripModelThe instance of GMTCTripModelthat generated the event.remainingRouteDistanceDistance 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. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemaining remainingWaypoints: [GMTSTripWaypoint]?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateRemainingWaypoints: (nullable NSArray<GMTSTripWaypoint *> *)remainingWaypoints;ParameterstripModelThe instance of GMTCTripModelthat generated the event.remainingWaypointsThe current remaining waypoints. 
- 
                  
                  Called when the trip’s waypoints have been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateIntermediateDestinations intermediateDestinations: [GMTSTerminalLocation]?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateIntermediateDestinations: (nullable NSArray<GMTSTerminalLocation *> *)intermediateDestinations;ParameterstripModelThe instance of GMTCTripModelthat generated the event.intermediateDestinationsThe current remaining intermediate waypoints for this trip. 
- 
                  
                  Called when traffic data has been updated for the active route segment of the trip. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateActiveRouteTraffic activeRouteTraffic: GMTSTrafficData?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateActiveRouteTraffic:(nullable GMTSTrafficData *)activeRouteTraffic;ParameterstripModelThe instance of GMTCTripModelthat generated the event.activeRouteTrafficThe 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 isGMTSTripStatusEnrouteToDropoff, the next significant location is the drop off location.
- 
                  
                  Called when traffic data has been updated for the remaining route segment of the trip. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didUpdateRemainingRouteTraffic remainingRouteTraffic: GMTSTrafficData?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didUpdateRemainingRouteTraffic: (nullable GMTSTrafficData *)remainingRouteTraffic;ParameterstripModelThe instance of GMTCTripModelthat generated the event.remainingRouteTrafficThe traffic data for the remaining route segment of the current trip. 
- 
                  
                  Called when the trip monitoring request error has been updated. DeclarationSwift optional func tripModel(_ tripModel: GMTCTripModel, didFailUpdateTripWithError error: (any Error)?)Objective-C - (void)tripModel:(nonnull GMTCTripModel *)tripModel didFailUpdateTripWithError:(nullable NSError *)error;ParameterstripModelThe instance of GMTCTripModelthat generated the event.errorThe error of the current trip monitoring request. The value could be nil.