简体   繁体   English

在iPhone上进行iAd测试

[英]iAd testing on iPhone

I'm having a bit of a problem testing iAd on the iPhone and on the simulator. 在iPhone和模拟器上测试iAd时出现问题。 The methods that are called when the ad is loaded or failed don't seem to be called when testing and Apple doesn't want apps to show empty frames when there are no ads to display. 测试时似乎未调用在广告加载或失败时调用的方法,并且Apple不想在没有广告显示时使应用程序显示空白帧。

Basically, what I did was to hide the AdView and show it only when the bannerViewDidLoadAd: is called (if the view isn't being shown already). 基本上,我所做的是隐藏AdView并仅在bannerViewDidLoadAd:被调用时显示(如果视图尚未显示)。 I've placed some NSLogs on both the bannerViewDidLoadAd: and bannerView:didFailToReceiveAdWithError:, but when I run on both the simulator or on the device, nothing is ever logged. 我已经在bannerViewDidLoadAd:和bannerView:didFailToReceiveAdWithError:上放置了一些NSLog,但是当我在模拟器或设备上运行时,都不会记录任何日志。

Is this the normal behavior when simulating/testing an app with iAds? 使用iAds模拟/测试应用程序时,这是正常行为吗? Is there any way of making sure it's actually working properly? 有什么方法可以确保它实际上正常工作吗?

Thanks for your time. 谢谢你的时间。

您确定已将iAd上的委托设置为指向ViewController或包含bannerViewDidLoadAd和bannerView:didFailToReceiveAdWithError方法的类吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM