GoogleRidesharingConsumer Framework Reference

GMTCTripService

@interface GMTCTripService : NSObject

Provides methods for accessing trip session(s).

  • Creates and returns an instance of GMTCTripModel by the given trip name. If a trip session instance has already been created for the given trip name, then that instance will be returned. The instance of the TripModel created or retrieved can be configured via the sessionOptions of GMTCTripModel. Usually this sessionOptions property can be used to adjust the refresh time interval between the repeated trip info polling. see the comment in the class GMTCTripModelOptions for more details.

    Declaration

    Swift

    func tripModel(forTripName tripName: String) -> GMTCTripModel?

    Objective-C

    - (nullable GMTCTripModel *)tripModelForTripName:(nonnull NSString *)tripName;

    Parameters

    tripName

    The trip name for identifying a trip.

  • Returns whether there has been a trip session created by the GMTCTripService.

    Declaration

    Swift

    func hasTripModel(forTripName tripName: String) -> Bool

    Objective-C

    - (BOOL)hasTripModelForTripName:(nonnull NSString *)tripName;

    Parameters

    tripName

    The trip name for identifying a trip.

  • Returns all the trip session objects created by this trip service.

    Declaration

    Swift

    func allTripModels() -> [GMTCTripModel]

    Objective-C

    - (nonnull NSArray<GMTCTripModel *> *)allTripModels;
  • Returns all the trip session objects created by this trip service which are actively running.

    Declaration

    Swift

    func activeTripModels() -> [GMTCTripModel]

    Objective-C

    - (nonnull NSArray<GMTCTripModel *> *)activeTripModels;
  • Unavailable

    This class has no public initializers.

    Declaration

    Objective-C

    - (null_unspecified instancetype)init;