Is it a problem when an iAd may be obscured?

Peter Fortuin picture Peter Fortuin · Nov 11, 2010 · Viewed 13k times · Source

I added the ADBannerView to a view and when I load the app I get the following message:

ADBannerView: WARNING A banner view (0x7a023c0) has an ad but may be obscured. This message is only printed once per banner view.

As far as I can see the entire banner is visible on the screen. Is this really a problem? Or is it only a warning that I can ignore?

Answer

Chris Ladd picture Chris Ladd · Feb 28, 2011

As Stephen Darlington says, it's a good idea to figure out what the issue is. An easy way to double-check this in code (from a view controller) would be:

     // bring your bannerView to the front
   [self.view bringSubviewToFront:bannerView];

     // and make sure it's positioned onscreen.
    bannerView.frame = CGRectMake(0.0, 0.0, bannerView.frame.size.width, bannerView.frame.size.height);

Assuming you had an iVar / IBOutlet to your AdBannerView called bannerView, this would take care of any interface builder positioning issues, and make sure bannerView wasn't covered by anything.

From my experience, nothing bad happens if the ad is offscreen, however, the iAd will not load new ads until it knows it is fully onscreen. So, as you start up your app,

  1. Your AdBannerView will attempt to load an advertisement, whether it is onscreen or not.

  2. Depending on whether or not it is successful, your AdBannerViewDelegate will receive either

    a) bannerViewDidLoadAd: (proceed to step 3) or

    b) bannerView: didFailToReceiveAdWithError: (the AdBannerView will try again on its own)

  3. At that point, the ball is in your court as to what to do with said bannerView, if in fact it did load an ad. An easy way to check for this in code is yourBannerView.bannerLoaded, which will return YES if it has an ad, or NO if it doesn't. And so...

  4. How you handle the AdBannerView after it successfully loads its initial ad determines how it will behave in the future. You do not have to place it onscreen immediately -- choose a time that makes sense within your application. However, a banner view that has successfully loaded an ad will NOT try to load another one until it is onscreen. (Makes sense, right?) The tricky part is....

    4b) you also won't get any new delegate messages from that bannerView, so if you're not moving the bannerView onscreen immediately upon getting the bannerViewDidLoadAd delegate message, you'll have to implement some kind of control structure on your own to handle when, if at all, you DO move it onscreen, at which point it will begin asking the ad server for more ads, and you'll get more delegate messages, and the cycle begins anew.

So, to sum up: It's only a problem if your iAd is obscured if you'd like to serve more iAds and get paid. However, eCPM has been very, very low lately, so maybe that's not such an issue after all ;)