# GMSServices

    @interface GMSServices : NSObject

Service class for the Google Maps SDK for iOS.

This class is not thread safe. All methods should only be invoked on the main thread.
- `


  ### [+sharedServices](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)sharedServices)


  ` Provides the shared instance of `GMSServices` for the Google Maps SDK for iOS, creating it if
  necessary. Classes such as `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSMapView.html` and `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSPanoramaView.html` will hold this instance to provide
  their connection to Google.

  This is an opaque object. If your application often creates and destroys view or service classes
  provided by the Google Maps SDK for iOS, it may be useful to hold onto this object directly, as
  otherwise your connection to Google may be restarted on a regular basis. It also may be useful to
  take this object in advance of the first map creation, to reduce initial map creation performance
  cost.

  This method will throw an exception if `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices.html#/c:objc(cs)GMSServices(cm)provideAPIKey:` has not been called.

  #### Declaration

  Swift

      class func sharedServices() -> any NSObjectProtocol

  Objective-C

      + (nonnull id<NSObject>)sharedServices;

- `


  ### [+provideAPIKey:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)provideAPIKey:)


  ` Provides your API key to the Google Maps SDK for iOS. This key is generated for your application
  via the Google Cloud Platform Console, and is paired with your application's bundle ID to
  identify it. This must be called exactly once by your application before any iOS Maps SDK
  object is initialized.

  #### Declaration

  Swift

      class func provideAPIKey(_ APIKey: String) -> Bool

  Objective-C

      + (BOOL)provideAPIKey:(nonnull NSString *)APIKey;

  #### Return Value

  `YES` if the APIKey was successfully provided.
- `


  ### [+provideAPIOptions:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)provideAPIOptions:)


  ` Provides your API options to the Google Maps SDK for iOS. Pass an array containing an NSString
  for each option. These options apply to all maps.

  This may be called exactly once by your application and must be called before any iOS Maps SDK
  object is initialized.

  #### Declaration

  Swift

      class func provideAPIOptions(_ APIOptions: [String]) -> Bool

  Objective-C

      + (BOOL)provideAPIOptions:(nonnull NSArray<NSString *> *)APIOptions;

  #### Return Value

  `YES` if all the APIOptions were successfully provided.
- `


  ### [+setAbnormalTerminationReportingEnabled:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)setAbnormalTerminationReportingEnabled:)


  ` Enables reporting of abnormal SDK terminations such as 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 services instance is initialized.

  This property must be set from the main thread.

  #### Declaration

  Swift

      class func setAbnormalTerminationReportingEnabled(_ enabled: Bool)

  Objective-C

      + (void)setAbnormalTerminationReportingEnabled:(BOOL)enabled;

- `


  ### [+openSourceLicenseInfo](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)openSourceLicenseInfo)


  ` Returns the open source software license information for Google Maps SDK for iOS. This
  information must be made available within your application.

  #### Declaration

  Swift

      class func openSourceLicenseInfo() -> String

  Objective-C

      + (nonnull NSString *)openSourceLicenseInfo;

- `


  ### [+SDKVersion](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)SDKVersion)


  ` Returns the version for this release of the Google Maps SDK for iOS. For example, "1.0.0".

  #### Declaration

  Swift

      class func sdkVersion() -> String

  Objective-C

      + (nonnull NSString *)SDKVersion;

- `


  ### [+SDKLongVersion](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)SDKLongVersion)


  ` Returns the long version for this release of the Google Maps SDK for iOS. For example, "1.0.0
  (102.1)".

  #### Declaration

  Swift

      class func sdkLongVersion() -> String

  Objective-C

      + (nonnull NSString *)SDKLongVersion;

- `


  ### [+addInternalUsageAttributionID:](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cm)addInternalUsageAttributionID:)


  ` Adds a usage attribution ID to the initializer, which helps Google understand which libraries and
  samples are helpful to developers, such as usage of a marker clustering library.
  To opt out of sending the usage attribution ID, it is safe to delete this function call or
  replace the value with an empty string.

  #### Declaration

  Swift

      class func addInternalUsageAttributionID(_ internalUsageAttributionID: String)

  Objective-C

      + (void)addInternalUsageAttributionID:
          (nonnull NSString *)internalUsageAttributionID;

  #### Parameters

  |---|---|
  | ` internalUsageAttributionID ` | The usage attribution ID to add |

[## Navigation](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/Navigation)

- `


  ### [appCheckTokenProvider](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(cpy)appCheckTokenProvider)


  ` App Check token provider for the Navigation SDK.

  #### Declaration

  Swift

      class var appCheckTokenProvider: (any https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSAppCheckTokenProvider.html)? { get set }

  Objective-C

      @property (class, nonatomic, nullable) id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSAppCheckTokenProvider.html> appCheckTokenProvider;

- `


  ### [appCheckTokenProvider](https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices#/c:objc(cs)GMSServices(py)appCheckTokenProvider)


  ` Deprecated

  Use the class property GMSServices.appCheckTokenProvider instead.
  App Check token provider for the Navigation SDK.

  @deprecated Use the class property `https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices.html#/c:objc(cs)GMSServices(cpy)appCheckTokenProvider` instead.

  #### Declaration

  Objective-C

      @property (nonatomic, nullable) id<https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Protocols/GMSAppCheckTokenProvider.html> https://developers.google.com/maps/documentation/navigation/ios-sdk/reference/objc/Classes/GMSServices.html#/c:objc(cs)GMSServices(cpy)appCheckTokenProvider;