当iAd可能被遮挡时,这是一个问题吗? [英] Is it a problem when an iAd may be obscured?

查看:94
本文介绍了当iAd可能被遮挡时,这是一个问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将ADBannerView添加到视图中,当我加载应用程序时,我收到以下消息:

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

ADBannerView:警告横幅视图(0x7a023c0)有广告但是可能会被遮盖。此消息仅在每个横幅视图中打印一次。

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?

推荐答案

正如Stephen Darlington所说,最好弄清楚是什么问题是。在代码中(从视图控制器)仔细检查这个的简单方法是:

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);

假设您有一个名为bannerView的AdBannerView的iVar / IBOutlet,这将照顾任何界面构建器定位问题,并确保bannerView没有被任何内容覆盖。

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.

根据我的经验,如果广告在屏幕外,没有任何不好的事情发生,但iAd不会加载新的广告直到它知道它完全在屏幕上。因此,当您启动应用时,

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. 您的AdBannerView将尝试加载广告,无论是否在屏幕上。

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

根据是否成功,您的AdBannerViewDelegate将收到

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

a)bannerViewDidLoadAd :(继续执行第3步)或

a) bannerViewDidLoadAd: (proceed to step 3) or

b)bannerView:didFailToReceiveAdWithError :( AdBannerView将自行重试)

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

此时,球在你的球场上是关于如何处理所述bannerView,如果事实上它确实加载了一个广告。在代码中检查这一点的简单方法是yourBannerView.bannerLoaded,如果有广告则返回YES,否则返回NO。所以...

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

在成功加载其初始广告后,如何处理AdBannerView将决定它在未来的行为方式。您不必立即将其放在屏幕上 - 选择在您的应用程序中有意义的时间。但是,已成功加载广告的横幅视图不会尝试加载另一个广告,直到它在屏幕上。 (有道理,对吗?)棘手的部分是....

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)你也不会从该bannerView获得任何新的委托消息,所以如果你'获取bannerViewDidLoadAd委托消息后,不要立即在屏幕上移动bannerView,你必须自己实现某种控制结构来处理何时,如果有的话,你要在屏幕上移动它,此时它将开始询问更多广告的广告服务器,您将获得更多的委托消息,并且周期重新开始。

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.

所以,总结:如果您希望提供更多的iAd并获得报酬,那么如果您的iAd被遮挡,那么这只是一个问题。然而,最近eCPM非常非常低,所以也许这毕竟不是一个问题;)

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 ;)

这篇关于当iAd可能被遮挡时,这是一个问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆