# GoogleRidesharingConsumer Framework Reference

# GMTCTripService

    @interface GMTCTripService : NSObject

Provides methods for accessing trip session(s).
- `


  ### [-tripModelForTripName:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripService#/c:objc(cs)GMTCTripService(im)tripModelForTripName:)


  ` Creates and returns an instance of `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html` 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 `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html`. 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
  `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModelOptions.html` for more details.

  #### Declaration

  Swift

      func tripModel(forTripName tripName: String) -> https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html?

  Objective-C

      - (nullable https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html *)tripModelForTripName:(nonnull NSString *)tripName;

  #### Parameters

  |---|---|
  | ` tripName ` | The trip name for identifying a trip. |

- `


  ### [-hasTripModelForTripName:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripService#/c:objc(cs)GMTCTripService(im)hasTripModelForTripName:)


  ` 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. |

- `


  ### [-allTripModels](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripService#/c:objc(cs)GMTCTripService(im)allTripModels)


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

  #### Declaration

  Swift

      func allTripModels() -> [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html]

  Objective-C

      - (nonnull NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html *> *)allTripModels;

- `


  ### [-activeTripModels](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripService#/c:objc(cs)GMTCTripService(im)activeTripModels)


  ` Returns all the trip session objects created by this trip service which are actively running.

  #### Declaration

  Swift

      func activeTripModels() -> [https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html]

  Objective-C

      - (nonnull NSArray<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripModel.html *> *)activeTripModels;

- `


  ### [-init](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCTripService#/c:objc(cs)GMTCTripService(im)init)


  ` Unavailable
  This class has no public initializers.

  #### Declaration

  Objective-C

      - (null_unspecified instancetype)init;