AdMob Custom Events

AATAdMobMediationAdapter

AATAdMobMediationAdapter is a Gravite framework that implements AdMob custom events. It supports the following ad formats:

  • Banners

  • Fullscreen

  • Rewarded Video

  • Native Ads

How AATAdMobMediationAdapter Works

  • Publishers must prepare their AdMob dashboard by adding custom events to their mediation (See Google instructions Add a custom event).

  • 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 Google’s documentation).

  • 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.

Integration steps

  • 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.

  • Add AATAdMobMediationAdapter to your Podfile:

    • 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:

  • 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 GMA documentation (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:

AATAdMobMediationAdapterManager.sharedInstance().viewControllerDidAppear(self)
  • In the viewWillDisappear() of the same viewController, call the AATAdMobMediationAdapter public API:

AATAdMobMediationAdapterManager.sharedInstance().viewControllerWillDisappear()

If your integration is successfully done, you should see logs with this pattern AATAdMobMediationAdapter [LOG_LEVEL]: while testing your integration. If not, please revisit your dashboard and the above steps again.

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'

BlueStack

pod 'AATKit/BlueStack'

CriteoSDK

pod 'AATKit/CriteoSDK'

DFP

pod 'AATKit/DFP'

Facebook

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'

Last updated