Warning: Creating default object from empty value in /home/dreambot/public_html/wiki/wp-content/themes/wikeasi/functions/admin-hooks.php on line 160

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];
}

Revisions

Tags:

Comments are closed.