Search code examples
iosxcodeiadmopub

Mo pub + iAds in iPhone landscape game


Now I got one requirement to use MoPub+iAds in iPhone game.

I used mo pub sdk and initialized view like this

MPAdView *moPubAdView =  [[MPAdView alloc] initWithAdUnitId:MOPUB_ADS_ACCOUNT_ID size:MOPUB_BANNER_SIZE];

But this displays 320x50 in size. How to enable iAd for this view? Now it is displaying only mo pub ads.


Solution

  • If you want the slim iAd banner you have to pass the correct CGSize in the size parameter. In this case CGSizeMake(480, 32). To enable iAds for your App go to itunesconnect.apple.com and add your app with your bundle ID. After that find the Button which says iAd Network Settings and enable iAds.

    The slim lanscape is rare. Your fillrate will be low. I recommend to use MMA Banner (320, 50) even for landscape orientation. Do this by using this function:

    [mpAdView lockNativeAdsToOrientation:MPNativeAdOrientationPortrait];
    

    Also be sure to import the iAd Adapter. Its by default included.