GoogleMobileAds Framework Reference | Firebase
GoogleMobileAds Framework Reference
GADMediationAdapter
Receives messages and requests from the Google Mobile Ads SDK. Provides GMA to 3P SDK communication.
Adapters are initialized on a background queue and should avoid using the main queue until load time.
Methods
version()
Returns the adapter version.
Declaration
Swiftstatic func version() -> GADVersionNumberadSDKVersion()
Returns the ad SDK version.
Declaration
Swiftstatic func adSDKVersion() -> GADVersionNumbernetworkExtrasClass()
The extras class that is used to specify additional parameters for a request to this ad network. Returns Nil if the network doesn’t have publisher provided extras.
Declaration
Swiftstatic func networkExtrasClass() -> GADAdNetworkExtras.Type?setUpWith(_:completionHandler:)
Tells the adapter to set up its underlying ad network SDK and perform any necessary prefetching or configuration work. The adapter must call completionHandler once the adapter can service ad requests, or if it encounters an error while setting up.
Declaration
Swiftoptional static func setUpWith(_ configuration: GADMediationServerConfiguration, completionHandler: @escaping GADMediationAdapterSetUpCompletionBlock)loadBanner(for:completionHandler:)
Asks the adapter to load a banner ad with the provided ad configuration. The adapter must call back completionHandler with the loaded ad, or it may call back with an error. This method is called on the main thread, and completionHandler must be called back on the main thread.
Declaration
Swiftoptional func loadBanner(for adConfiguration: GADMediationBannerAdConfiguration, completionHandler: @escaping GADMediationBannerLoadCompletionHandler)loadInterstitial(for:completionHandler:)
Asks the adapter to load an interstitial ad with the provided ad configuration. The adapter must call back completionHandler with the loaded ad, or it may call back with an error. This method is called on the main thread, and completionHandler must be called back on the main thread.
Declaration
Swiftoptional func loadInterstitial(for adConfiguration: GADMediationInterstitialAdConfiguration, completionHandler: @escaping GADMediationInterstitialLoadCompletionHandler)loadNativeAd(for:completionHandler:)
Asks the adapter to load a native ad with the provided ad configuration. The adapter must call back completionHandler with the loaded ad, or it may call back with an error. This method is called on the main thread, and completionHandler must be called back on the main thread.
Declaration
Swiftoptional func loadNativeAd(for adConfiguration: GADMediationNativeAdConfiguration, completionHandler: @escaping GADMediationNativeLoadCompletionHandler)loadRewardedAd(for:completionHandler:)
Asks the adapter to load a rewarded ad with the provided ad configuration. The adapter must call back completionHandler with the loaded ad, or it may call back with an error. This method is called on the main thread, and completionHandler must be called back on the main thread.
Declaration
Swiftoptional func loadRewardedAd(for adConfiguration: GADMediationRewardedAdConfiguration, completionHandler: @escaping GADMediationRewardedLoadCompletionHandler)setUp()
Deprecated. To be removed before launch. Use setUpWithConfiguration:completionHandler:.
Declaration
Swiftoptional static func setUp()update(_:)
Deprecated. To be removed before launch. Use setUpWithConfiguration:completionHandler:.
Declaration
Swiftoptional static func update(_ configuration: GADMediationServerConfiguration)
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.