GADMediationAdapter
@protocol GADMediationAdapter <NSObject>
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.
-
Returns the adapter version.
Declaration
Swift
static func adapterVersion() -> GADVersionNumber
Objective-C
+ (GADVersionNumber)adapterVersion;
-
Returns the ad SDK version.
Declaration
Swift
static func adSDKVersion() -> GADVersionNumber
Objective-C
+ (GADVersionNumber)adSDKVersion;
-
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
Swift
static func networkExtrasClass() -> (any GADAdNetworkExtras.Type)?
Objective-C
+ (nullable Class<GADAdNetworkExtras>)networkExtrasClass;
-
Returns an initialized mediation adapter.
Declaration
Swift
init()
Objective-C
- (nonnull instancetype)init;
-
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
Swift
optional static func setUpWith(_ configuration: GADMediationServerConfiguration) async throws
Objective-C
+ (void)setUpWithConfiguration: (nonnull GADMediationServerConfiguration *)configuration completionHandler:(nonnull GADMediationAdapterSetUpCompletionBlock) 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
Swift
optional func loadBanner(for adConfiguration: GADMediationBannerAdConfiguration, completionHandler: @escaping GADMediationBannerLoadCompletionHandler)
Objective-C
- (void)loadBannerForAdConfiguration: (nonnull GADMediationBannerAdConfiguration *)adConfiguration completionHandler: (nonnull GADMediationBannerLoadCompletionHandler) 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
Swift
optional func loadInterstitial(for adConfiguration: GADMediationInterstitialAdConfiguration, completionHandler: @escaping GADMediationInterstitialLoadCompletionHandler)
Objective-C
- (void) loadInterstitialForAdConfiguration: (nonnull GADMediationInterstitialAdConfiguration *)adConfiguration completionHandler: (nonnull GADMediationInterstitialLoadCompletionHandler) 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
Swift
optional func loadNativeAd(for adConfiguration: GADMediationNativeAdConfiguration, completionHandler: @escaping GADMediationNativeLoadCompletionHandler)
Objective-C
- (void)loadNativeAdForAdConfiguration: (nonnull GADMediationNativeAdConfiguration *)adConfiguration completionHandler: (nonnull GADMediationNativeLoadCompletionHandler) 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
Swift
optional func loadRewardedAd(for adConfiguration: GADMediationRewardedAdConfiguration, completionHandler: @escaping GADMediationRewardedLoadCompletionHandler)
Objective-C
- (void)loadRewardedAdForAdConfiguration: (nonnull GADMediationRewardedAdConfiguration *)adConfiguration completionHandler: (nonnull GADMediationRewardedLoadCompletionHandler) completionHandler;
-
Asks the adapter to load a rewarded 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
Swift
optional func loadRewardedInterstitialAd(for adConfiguration: GADMediationRewardedAdConfiguration, completionHandler: @escaping GADMediationRewardedLoadCompletionHandler)
Objective-C
- (void) loadRewardedInterstitialAdForAdConfiguration: (nonnull GADMediationRewardedAdConfiguration *)adConfiguration completionHandler: (nonnull GADMediationRewardedLoadCompletionHandler) completionHandler;
-
Asks the adapter to load an app open 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
Swift
optional func loadAppOpenAd(for adConfiguration: GADMediationAppOpenAdConfiguration, completionHandler: @escaping GADMediationAppOpenLoadCompletionHandler)
Objective-C
- (void)loadAppOpenAdForAdConfiguration: (nonnull GADMediationAppOpenAdConfiguration *)adConfiguration completionHandler: (nonnull GADMediationAppOpenLoadCompletionHandler) completionHandler;
-
Deprecated
Interscroller mediation is no longer supported. This API will be removed in a future release.
Asks the adapter to load an interscroller 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
Swift
optional func loadInterscrollerAd(for adConfiguration: GADMediationBannerAdConfiguration, completionHandler: @escaping GADMediationInterscrollerAdLoadCompletionHandler)
Objective-C
- (void) loadInterscrollerAdForAdConfiguration: (nonnull GADMediationBannerAdConfiguration *)adConfiguration completionHandler: (nonnull GADMediationInterscrollerAdLoadCompletionHandler) completionHandler;