GoogleRidesharingConsumer Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMTCServices
@interface GMTCServices : NSObject
Service class for the Google Consumer Ridesharing SDK for iOS.
-
Declaration
Objective-C
@property (nonatomic, readonly) GMTCTripService *_Nonnull tripService;
-
Main Rodesharing SDK init method. Should be called before any other method.
Declaration
Swift
class func setAccessTokenProvider(_ accessTokenProvider: any GMTCAuthorization, providerID: String)
Objective-C
+ (void)setAccessTokenProvider:
(nonnull id<GMTCAuthorization>)accessTokenProvider
providerID:(nonnull NSString *)providerID;
Parameters
accessTokenProvider
|
An implementation of GMTCAuthorization, which can provide a valid
access token.
|
providerID
|
An ID of the Google Cloud Project (e.g. sample-consumer-project).
|
-
Provides the shared instance of GMTCServices
for the Google Ridesharing SDK for iOS.
Ridesharing classes will hold this instance to provide their connection to Google.
This method will throw an exception if +setAccessTokenProvider:
has not been called.
Declaration
Swift
class func shared() -> Self
Objective-C
+ (nonnull instancetype)sharedServices;
-
Returns the version for this release of the Google Ridesharing SDK for iOS. For example, “0.4.4”.
The version number is in the SDK’s resource bundle.
Declaration
Swift
class func sdkVersion() -> String
Objective-C
+ (nonnull NSString *)SDKVersion;
-
Returns the long formatted version of the string. It includes the version string and bundle
version in format “ ()”. For example, “0.4.4 (234.2)”.
Declaration
Swift
class func sdkLongVersion() -> String
Objective-C
+ (nonnull NSString *)SDKLongVersion;
-
Enables reporting of abnormal SDK terminations such as when the app crashes while the SDK is
still running. This allows Google to improve SDK stability when applicable. The default is YES
and value must be updated before the sharedServices
is called.
This property must be set from the main thread.
Declaration
Swift
class func setAbnormalTerminationReportingEnabled(_ abnormalTerminationReportingEnabled: Bool)
Objective-C
+ (void)setAbnormalTerminationReportingEnabled:
(BOOL)abnormalTerminationReportingEnabled;
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\u003eGMTCServices\u003c/code\u003e class is the main service class for the Google Consumer Ridesharing SDK for iOS, providing access to the \u003ccode\u003eGMTCTripService\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBefore using any other method, initialize the SDK by calling \u003ccode\u003esetAccessTokenProvider:providerID:\u003c/code\u003e with a valid \u003ccode\u003eGMTCAuthorization\u003c/code\u003e implementation and a Google Cloud Project ID.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esharedServices\u003c/code\u003e method returns a shared instance of \u003ccode\u003eGMTCServices\u003c/code\u003e, but it will throw an exception if \u003ccode\u003esetAccessTokenProvider:\u003c/code\u003e has not been called first.\u003c/p\u003e\n"],["\u003cp\u003eRetrieve the current SDK version using \u003ccode\u003eSDKVersion\u003c/code\u003e or \u003ccode\u003eSDKLongVersion\u003c/code\u003e, which provides detailed release information.\u003c/p\u003e\n"],["\u003cp\u003eEnable or disable the reporting of abnormal SDK terminations using \u003ccode\u003esetAbnormalTerminationReportingEnabled:\u003c/code\u003e, which is set to \u003ccode\u003eYES\u003c/code\u003e by default and must be called before \u003ccode\u003esharedServices\u003c/code\u003e.\u003c/p\u003e\n"]]],["`GMTCServices` is the core service class for the Google Consumer Ridesharing SDK for iOS. Key actions include initializing the SDK via `setAccessTokenProvider:providerID:`, which must be called before any other method, and obtaining a shared instance using `sharedServices`. The class provides access to the `tripService`, and methods like `SDKVersion` and `SDKLongVersion` provide SDK version details. Lastly, `setAbnormalTerminationReportingEnabled:` manages reporting on SDK terminations.\n"],null,["# GoogleRidesharingConsumer Framework Reference\n\nGMTCServices\n============\n\n @interface GMTCServices : NSObject\n\nService class for the Google Consumer Ridesharing SDK for iOS.\n- `\n ``\n ``\n `\n\n ### [tripService](#/c:objc(cs)GMTCServices(py)tripService)\n\n `\n ` \n Return an instance of the [GMTCTripService](../Classes/GMTCTripService.html). \n\n #### Declaration\n\n Swift \n\n var tripService: ../Classes/GMTCTripService.html { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Classes/GMTCTripService.html *_Nonnull tripService;\n\n- `\n ``\n ``\n `\n\n ### [+setAccessTokenProvider:providerID:](#/c:objc(cs)GMTCServices(cm)setAccessTokenProvider:providerID:)\n\n `\n ` \n Main Rodesharing SDK init method. Should be called before any other method. \n\n #### Declaration\n\n Swift \n\n class func setAccessTokenProvider(_ accessTokenProvider: any ../Protocols/GMTCAuthorization.html, providerID: String)\n\n Objective-C \n\n + (void)setAccessTokenProvider:\n (nonnull id\u003c../Protocols/GMTCAuthorization.html\u003e)accessTokenProvider\n providerID:(nonnull NSString *)providerID;\n\n #### Parameters\n\n |-----------------------------|---------------------------------------------------------------------------------|\n | ` `*accessTokenProvider*` ` | An implementation of GMTCAuthorization, which can provide a valid access token. |\n | ` `*providerID*` ` | An ID of the Google Cloud Project (e.g. sample-consumer-project). |\n\n- `\n ``\n ``\n `\n\n ### [+sharedServices](#/c:objc(cs)GMTCServices(cm)sharedServices)\n\n `\n ` \n Provides the shared instance of `GMTCServices` for the Google Ridesharing SDK for iOS.\n Ridesharing classes will hold this instance to provide their connection to Google.\n\n This method will throw an exception if `+setAccessTokenProvider:` has not been called. \n\n #### Declaration\n\n Swift \n\n class func shared() -\u003e Self\n\n Objective-C \n\n + (nonnull instancetype)sharedServices;\n\n- `\n ``\n ``\n `\n\n ### [+SDKVersion](#/c:objc(cs)GMTCServices(cm)SDKVersion)\n\n `\n ` \n Returns the version for this release of the Google Ridesharing SDK for iOS. For example, \"0.4.4\".\n The version number is in the SDK's resource bundle. \n\n #### Declaration\n\n Swift \n\n class func sdkVersion() -\u003e String\n\n Objective-C \n\n + (nonnull NSString *)SDKVersion;\n\n- `\n ``\n ``\n `\n\n ### [+SDKLongVersion](#/c:objc(cs)GMTCServices(cm)SDKLongVersion)\n\n `\n ` \n Returns the long formatted version of the string. It includes the version string and bundle\n version in format \" ()\". For example, \"0.4.4 (234.2)\". \n\n #### Declaration\n\n Swift \n\n class func sdkLongVersion() -\u003e String\n\n Objective-C \n\n + (nonnull NSString *)SDKLongVersion;\n\n- `\n ``\n ``\n `\n\n ### [+setAbnormalTerminationReportingEnabled:](#/c:objc(cs)GMTCServices(cm)setAbnormalTerminationReportingEnabled:)\n\n `\n ` \n Enables reporting of abnormal SDK terminations such as when the app crashes while the SDK is\n still running. This allows Google to improve SDK stability when applicable. The default is `YES`\n and value must be updated before the `sharedServices` is called.\n\n This property must be set from the main thread. \n\n #### Declaration\n\n Swift \n\n class func setAbnormalTerminationReportingEnabled(_ abnormalTerminationReportingEnabled: Bool)\n\n Objective-C \n\n + (void)setAbnormalTerminationReportingEnabled:\n (BOOL)abnormalTerminationReportingEnabled;"]]