# GoogleRidesharingConsumer Framework Reference

# Protocols

The following protocols are available globally.
- `


  ### [GMTCAuthorization](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCAuthorization)


  ` Protocol used to provide authorization tokens for gRPC calls. These tokens
  give access to the Fleet Engine service accounts.

  The implementation should ensure that a valid authorization token is always available.
  The authorization token should have a minimum lifetime of 5 minutes to allow for requests to
  complete. Therefore, the authorization token must automatically renew expiring tokens and
  minimize the number of token refreshes by re-using a token until its lifetime nears its end.

  Implementations of this protocol must be thread-safe.

  #### Declaration

  Swift

      protocol GMTCAuthorization : NSObjectProtocol

  Objective-C

      @protocol GMTCAuthorization <NSObject>

[## GMTCMapViewDelegate](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols#/GMTCMapViewDelegate)

- `


  ### [GMTCMapViewDelegate](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewDelegate)


  ` Delegate for events on `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView`.

  #### Declaration

  Swift

      protocol GMTCMapViewDelegate : GMSMapViewDelegate

  Objective-C

      @protocol GMTCMapViewDelegate <GMSMapViewDelegate>

- `


  ### [GMTCMapViewSessionDelegate](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSessionDelegate)


  ` @}

  #### Declaration

  Swift

      protocol GMTCMapViewSessionDelegate : NSObjectProtocol

  Objective-C

      @protocol GMTCMapViewSessionDelegate <NSObject>

- `


  ### [GMTCMapViewSession](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession)


  `

  #### Declaration

  Swift

      protocol GMTCMapViewSession : NSObjectProtocol

  Objective-C

      @protocol GMTCMapViewSession <NSObject>
      @optional
      /**
       * Returns the current session state. The possible state can be referenced from
       * `GMTCMapViewSessionState`.
       */
      @property(nonatomic, nullable, weak) __kindof id<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSessionDelegate> delegate;

      @required
      /**
       * Returns the current session state. The possible state can be referenced from
       * `GMTCMapViewSessionState`.
       */
      @property(nonatomic, readonly) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTCMapViewSessionState state;

      /** Returns the host map view of the current session. */
      @property(nonatomic, nullable, weak, readonly) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView *hostMapView;

      /** Called by a `GMTCMapView` instance when the session has been added to it. */
      - (void)didAddToMapView:(https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView *)mapView;

      /** Called by a `GMTCMapView` instance when the session has been removed from it. */
      - (void)didRemoveFromMapView:(https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView *)mapView;

      @end

- `


  ### [GMTCTripModelSubscriber](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCTripModelSubscriber)


  ` A subscriber protocol for GMTCTripModel's event update.

  #### Declaration

  Swift

      protocol GMTCTripModelSubscriber : NSObjectProtocol

  Objective-C

      @protocol GMTCTripModelSubscriber <NSObject>

- `


  ### [GMTSRequestOptionsSupport](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTSRequestOptionsSupport)


  ` Extension for support of set request options.

  #### Declaration

  Swift

      protocol GMTSRequestOptionsSupport : NSObjectProtocol

  Objective-C

      @protocol GMTSRequestOptionsSupport <NSObject>