GoogleMobileAds Framework Reference

GADMobileAds

classGADMobileAds:NSObject

Google Mobile Ads SDK settings.

  • Returns the shared GADMobileAds instance.

    Declaration

    Swift

    classfuncsharedInstance()->GADMobileAds
  • Disables automated in app purchase (IAP) reporting. Must be called before any IAP transaction isinitiated. IAP reporting is used to track IAP ad conversions. Do not disable reporting if youuse IAP ads.

    Declaration

    Swift

    classfuncdisableAutomatedInAppPurchaseReporting()
  • Disables automated SDK crash reporting. If not called, the SDK records the original exceptionhandler if available and registers a new exception handler. The new exception handler onlyreports SDK related exceptions and calls the recorded original exception handler.

    Declaration

    Swift

    classfuncdisableSDKCrashReporting()
  • The application’s audio volume. Affects audio volumes of all ads relative to other audio output.Valid ad volume values range from 0.0 (silent) to 1.0 (current device volume). Use this methodonly if your application has its own volume controls (e.g., custom music or sound effectvolumes). Defaults to 1.0.

    Declaration

    Swift

    varapplicationVolume:Float{getset}
  • Indicates whether the application’s audio is muted. Affects initial mute state for all ads. Usethis method only if your application has its own volume controls (e.g., custom music or soundeffect muting). Defaults to NO.

    Declaration

    Swift

    varapplicationMuted:Bool{getset}
  • Manages the Google Mobile Ads SDK’s audio and video settings.

    Declaration

    Swift

    varaudioVideoManager:GADAudioVideoManager{get}
  • Request configuration that is common to all requests.

    Declaration

    Swift

    varrequestConfiguration:GADRequestConfiguration{get}
  • Initialization status of the ad networks available to the Google Mobile Ads SDK.

    Declaration

    Swift

    varinitializationStatus:GADInitializationStatus{get}
  • Returns YES if the current SDK version is at least |major|.|minor|.|patch|. This method can beused by libraries that depend on a specific minimum version of the Google Mobile Ads SDK to warndevelopers if they have an incompatible version.

    Available in Google Mobile Ads SDK 7.10 and onwards. Before calling this method check if theGADMobileAds’s shared instance responds to this method. Calling this method on a Google MobileAds SDK lower than 7.10 can crash the app.

    Declaration

    Swift

    funcisSDKVersion(atLeastMajormajor:Int,minor:Int,patch:Int)->Bool
  • Starts the Google Mobile Ads SDK. Call this method as early as possible to reduce latency on thesession’s first ad request. Calls completionHandler when the GMA SDK and all mediation networksare fully set up or if set-up times out. The Google Mobile Ads SDK starts on the first adrequest if this method is not called.

    Declaration

    Swift

    funcstart(completionHandler:GADInitializationCompletionHandler?=nil)
  • Configures the SDK using the settings associated with the given application ID.

    Declaration

    Swift

    classfuncconfigure(withApplicationIDapplicationID:String)

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2021-03-03 UTC.