我正在尝试在我的 iPhone 应用程序上放置 iAd 横幅。这是我声明横幅广告的地方:
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[banner setAlpha:1];
[UIView commitAnimations];
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];
}
当我在模拟器上测试时,测试广告立即显示。当我在我的设备上测试时,什么也没有显示。
我最近注册了 Apple 的 iAd 系统,但是当我尝试查看 iTunes Connect 的 iAd 部分时,它告诉我 iAd 网络当前不可用。这就是测试广告不会显示在我的设备上的原因吗?如果是这样,为什么它仍然出现在模拟器上?
这是因为在展示广告之前,您的设备必须联系iAD
servers, search threw the tens (if not hundreds) of thousands of ads, decide which one is the best fit for your app, send the information of the ad to your ios device, and then send a confirmation back to iAD
服务器,如果没有良好的互联网连接,这些都无法完成。
然而,关于ios simulator
,上述情况都不必发生,无论如何模拟器都会简单地显示测试广告。
我在应用程序商店中有两个应用程序,它们使用与您完全相同的代码,并显示广告,但有您所描述的延迟。因此,您的代码没有错误,广告显示的延迟是完全正常的。
所以,正如你所看到的,在 iAD 能够在实际的 ios 设备上显示之前,必须发生很多事情,即使如此,您也必须拥有强大的互联网连接
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)