GoogleRidesharingConsumer Framework Reference

  • GMTCTripService provides methods to access trip sessions, primarily through GMTCTripModel instances.

  • You can retrieve a GMTCTripModel instance for a specific trip name, reusing existing instances if they have already been created.

  • The GMTCTripService can determine if a GMTCTripModel instance exists for a given trip name, using the hasTripModelForTripName: method.

  • You can get all created trip session objects, or all actively running ones, using the allTripModels or activeTripModels methods, respectively.

  • The GMTCTripService class does not have any public initializers, making direct initialization unavailable.

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;