How To Setup Ad Mediation

Ad Mediation is great because at times ad networks may not be able to fill in all your ads. When this happens, you lose the opportunity to show an ad… and more importantly that will reduce your opportunity to get paid. There are plugins which can help you do this, but I also wanted to share some code snippets you can use or give to your programmer to setup your ad mediation.

Ad Mediation Resources:

  • AdWhirl (currently we are using this)
  • AdMob (has there own as well)

Do It Yourself Ad Mediation:

This example grabs an ad from ChartBoost if the RevMob fails to fill.
Important: This will not play nice if you also have banner ads! Banner ads which don’t fill will also trigger a call to revmobAdDidFailWithError which will then trigger a full screen ad to appear when you wanted to show just a banner.
To get around this, RevMob support advised using a separate delegate for either the full screen or the banner ads. 
Add “RevMobAdsDelegate” to your interface definition:

@interface AppDelegate : NSObject <UIApplicationDelegate, ChartboostDelegate, RevMobAdsDelegate, CCDirectorDelegate>

Call your add function : [RevMobAds showFullscreenAd];

Implement revmobAdDidFailWithError as follows:

– (void)revmobAdDidFailWithError:(NSError *)error

  // Show an interstitial
[self.mChartBoost showInterstitial];



Comments are closed.