GoogleRidesharingConsumer Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Protocols
The following protocols are available globally.
-
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>
-
Declaration
Swift
protocol GMTCMapViewDelegate : GMSMapViewDelegate
Objective-C
@protocol GMTCMapViewDelegate <GMSMapViewDelegate>
-
Declaration
Swift
protocol GMTCMapViewSessionDelegate : NSObjectProtocol
Objective-C
@protocol GMTCMapViewSessionDelegate <NSObject>
-
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<GMTCMapViewSessionDelegate> delegate;
@required
/**
* Returns the current session state. The possible state can be referenced from
* `GMTCMapViewSessionState`.
*/
@property(nonatomic, readonly) GMTCMapViewSessionState state;
/** Returns the host map view of the current session. */
@property(nonatomic, nullable, weak, readonly) GMTCMapView *hostMapView;
/** Called by a `GMTCMapView` instance when the session has been added to it. */
- (void)didAddToMapView:(GMTCMapView *)mapView;
/** Called by a `GMTCMapView` instance when the session has been removed from it. */
- (void)didRemoveFromMapView:(GMTCMapView *)mapView;
@end
-
A subscriber protocol for GMTCTripModel’s event update.
Declaration
Swift
protocol GMTCTripModelSubscriber : NSObjectProtocol
Objective-C
@protocol GMTCTripModelSubscriber <NSObject>
-
Extension for support of set request options.
Declaration
Swift
protocol GMTSRequestOptionsSupport : NSObjectProtocol
Objective-C
@protocol GMTSRequestOptionsSupport <NSObject>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGMTCAuthorization\u003c/code\u003e protocol provides authorization tokens for gRPC calls, ensuring continuous access to Fleet Engine service accounts with a minimum token lifetime of 5 minutes and thread-safe implementation.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGMTCMapViewDelegate\u003c/code\u003e protocol acts as a delegate for events on \u003ccode\u003eGMTCMapView\u003c/code\u003e, extending the \u003ccode\u003eGMSMapViewDelegate\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGMTCMapViewSessionDelegate\u003c/code\u003e and \u003ccode\u003eGMTCMapViewSession\u003c/code\u003e protocols manage the state and behavior of a map view session, including session state, host map view, and lifecycle events.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGMTCTripModelSubscriber\u003c/code\u003e protocol allows for subscribing to event updates from a \u003ccode\u003eGMTCTripModel\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGMTSRequestOptionsSupport\u003c/code\u003e protocol facilitates setting request options.\u003c/p\u003e\n"]]],["The document outlines six global protocols: `GMTCAuthorization`, `GMTCMapViewDelegate`, `GMTCMapViewSessionDelegate`, `GMTCMapViewSession`, `GMTCTripModelSubscriber`, and `GMTSRequestOptionsSupport`. `GMTCAuthorization` provides authorization tokens for gRPC calls, requiring thread safety and token renewal with a minimum 5-minute lifetime. `GMTCMapViewDelegate` is for map view events. `GMTCMapViewSession` manages session states, returning session states, the host map view, and informing when added or removed. The rest of the protocols include `GMTCTripModelSubscriber` for event updates and `GMTSRequestOptionsSupport` for setting request options.\n"],null,["# GoogleRidesharingConsumer Framework Reference\n\nProtocols\n=========\n\nThe following protocols are available globally.\n- `\n ``\n ``\n `\n\n ### [GMTCAuthorization](/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCAuthorization)\n\n `\n ` \n Protocol used to provide authorization tokens for gRPC calls. These tokens\n give access to the Fleet Engine service accounts.\n\n The implementation should ensure that a valid authorization token is always available.\n The authorization token should have a minimum lifetime of 5 minutes to allow for requests to\n complete. Therefore, the authorization token must automatically renew expiring tokens and\n minimize the number of token refreshes by re-using a token until its lifetime nears its end.\n\n Implementations of this protocol must be thread-safe. \n\n #### Declaration\n\n Swift \n\n protocol GMTCAuthorization : NSObjectProtocol\n\n Objective-C \n\n @protocol GMTCAuthorization \u003cNSObject\u003e\n\n[GMTCMapViewDelegate\n-------------------](#/GMTCMapViewDelegate)\n\n- `\n ``\n ``\n `\n\n ### [GMTCMapViewDelegate](/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewDelegate)\n\n `\n ` \n Delegate for events on [GMTCMapView](/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView). \n\n #### Declaration\n\n Swift \n\n protocol GMTCMapViewDelegate : GMSMapViewDelegate\n\n Objective-C \n\n @protocol GMTCMapViewDelegate \u003cGMSMapViewDelegate\u003e\n\n- `\n ``\n ``\n `\n\n ### [GMTCMapViewSessionDelegate](/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSessionDelegate)\n\n `\n ` \n @} \n\n #### Declaration\n\n Swift \n\n protocol GMTCMapViewSessionDelegate : NSObjectProtocol\n\n Objective-C \n\n @protocol GMTCMapViewSessionDelegate \u003cNSObject\u003e\n\n- `\n ``\n ``\n `\n\n ### [GMTCMapViewSession](/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession)\n\n `\n ` \n\n #### Declaration\n\n Swift \n\n protocol GMTCMapViewSession : NSObjectProtocol\n\n Objective-C \n\n @protocol GMTCMapViewSession \u003cNSObject\u003e\n @optional\n /**\n * Returns the current session state. The possible state can be referenced from\n * `GMTCMapViewSessionState`.\n */\n @property(nonatomic, nullable, weak) __kindof id\u003c/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSessionDelegate\u003e delegate;\n\n @required\n /**\n * Returns the current session state. The possible state can be referenced from\n * `GMTCMapViewSessionState`.\n */\n @property(nonatomic, readonly) /maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTCMapViewSessionState state;\n\n /** Returns the host map view of the current session. */\n @property(nonatomic, nullable, weak, readonly) /maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView *hostMapView;\n\n /** Called by a `GMTCMapView` instance when the session has been added to it. */\n - (void)didAddToMapView:(/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView *)mapView;\n\n /** Called by a `GMTCMapView` instance when the session has been removed from it. */\n - (void)didRemoveFromMapView:(/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView *)mapView;\n\n @end\n\n- `\n ``\n ``\n `\n\n ### [GMTCTripModelSubscriber](/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCTripModelSubscriber)\n\n `\n ` \n A subscriber protocol for GMTCTripModel's event update. \n\n #### Declaration\n\n Swift \n\n protocol GMTCTripModelSubscriber : NSObjectProtocol\n\n Objective-C \n\n @protocol GMTCTripModelSubscriber \u003cNSObject\u003e\n\n- `\n ``\n ``\n `\n\n ### [GMTSRequestOptionsSupport](/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTSRequestOptionsSupport)\n\n `\n ` \n Extension for support of set request options. \n\n #### Declaration\n\n Swift \n\n protocol GMTSRequestOptionsSupport : NSObjectProtocol\n\n Objective-C \n\n @protocol GMTSRequestOptionsSupport \u003cNSObject\u003e"]]