AdMob Custom Events
Last updated
Last updated
AATAdMobMediationAdapter is a Gravite framework that implements . It supports the following ad formats:
Banners
Fullscreen
Rewarded Video
Native Ads
Publishers must prepare their AdMob dashboard by adding custom events to their mediation (See Google instructions ).
AATAdMobMediationAdapter Implements AdMob custom events delegates.
The publisher requests an ad (Banner, Fullscreen, RewardedVideo or NativeAd) normally from GoogleMobileAds (To learn how to request an ad from GoogleMobileAds, please visit ).
GoogleMobileAds internally calls AATAdMobMediationAdapter asking for an ad.
AATAdMobMediationAdapter internally calls AATKit asking for an ad.
When AATKit responds, AATAdMobMediationAdapter would notify GoogleMobileAds with the response using the AdMob custom events delegate methods. And in return, GoogleMobileAds will notify you of the response using the normal GoogleMobileAds callback.
In your AdMob dashboard, click on mediation on the left menu.
Create a new mediation for each ad format (Please choose the proper ad unit you are using in your application in the GoogleMobileAds integration).
Open the newly created mediation and add a custom event.
Edit the custom event and add the proper class names from the following:
Banner class name: AATAdMobBannerAdapter
.
Interstitial class name: AATAdMobInterstitialAdapter
.
Rewarded video class name: AATAdMobRewardedVideoAdapter
.
Native ads class name: AATAdMobNativeAdAdapter
.
Integrate AATAdMobMediationAdapter:
Cocoapods:
pod 'AATKit/AATAdMobMediationAdapter'
The above line will add only the basic required dependencies of AATAdMobMediationAdapter (AATKit-Core and GoogleMobileAds)
To add other ad networks, you must add them via AATKit by adding the following to your Podfile:
pod 'AATKit/<SOME_NETWORK>'
For more information about adding ad networks, please check
Swift Package Manager:
Follow the same SPM steps .
In the last step, select AATKit-Core
, AATAdMobMediationAdapter
and other ad networks' adapters as needed.
Initialise AATKit as early as you can (in the AppDelegate didFinishLaunchingWithOptions
for example) by calling:
AATAdMobMediationAdapterManager.shared.initAATKit()
Integrate with GoogleMobileAds different ad formats following their (Please add the proper app ID to your info.plist under GADApplicationIdentifier
key)
In the viewDidAppear()
of the viewController that requests an ad from Google, call the following AATAdMobMediationAdapterManager
public API:
In the viewWillDisappear()
of the same viewController, call the AATAdMobMediationAdapterManager
public API:
Here’s a list of the recommended ad networks and how to add them to your project:
AdColony
pod 'AATKit/AdColony'
Admob
pod 'AATKit/Admob'
AdX
pod 'AATKit/AdX'
AppLovinMAX
pod 'AATKit/AppLovinMAX'
AppLovinSDK
pod 'AATKit/AppLovinSDK'
AppNexus
pod 'AATKit/AppNexus'
CriteoSDK
pod 'AATKit/CriteoSDK'
DFP
pod 'AATKit/DFP'
pod 'AATKit/Facebook'
FeedAd
pod 'AATKit/FeedAd'
Inmobi
pod 'AATKit/Inmobi'
IronSource
pod 'AATKit/IronSource'
OguryAds
pod 'AATKit/OguryAds'
PrebidSDK
pod 'AATKit/PrebidSDK'
Pubnative
pod 'AATKit/PubNative'
Smaato
pod 'AATKit/Smaato'
SmartAdServer
pod 'AATKit/SmartAdServer'
Unity
pod 'AATKit/Unity'
Vungle
pod 'AATKit/Vungle'