AI-generated Key Takeaways
-
The
GMTCServicesclass is the main service class for the Google Consumer Ridesharing SDK for iOS, providing access to theGMTCTripService. -
Before using any other method, initialize the SDK by calling
setAccessTokenProvider:providerID:with a validGMTCAuthorizationimplementation and a Google Cloud Project ID. -
The
sharedServicesmethod returns a shared instance ofGMTCServices, but it will throw an exception ifsetAccessTokenProvider:has not been called first. -
Retrieve the current SDK version using
SDKVersionorSDKLongVersion, which provides detailed release information. -
Enable or disable the reporting of abnormal SDK terminations using
setAbnormalTerminationReportingEnabled:, which is set toYESby default and must be called beforesharedServices.
GMTCServices
@interface GMTCServices : NSObjectService class for the Google Consumer Ridesharing SDK for iOS.
-
Return an instance of the
GMTCTripService.Declaration
Swift
var tripService: GMTCTripService { get }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
accessTokenProviderAn implementation of GMTCAuthorization, which can provide a valid access token.
providerIDAn ID of the Google Cloud Project (e.g. sample-consumer-project).
-
Provides the shared instance of
GMTCServicesfor 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() -> SelfObjective-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() -> StringObjective-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() -> StringObjective-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
YESand value must be updated before thesharedServicesis called.This property must be set from the main thread.
Declaration
Swift
class func setAbnormalTerminationReportingEnabled(_ abnormalTerminationReportingEnabled: Bool)Objective-C
+ (void)setAbnormalTerminationReportingEnabled: (BOOL)abnormalTerminationReportingEnabled;