简体   繁体   English

iAd实施有问题吗?

[英]Problem with iAd implementation?

I am able to see iAd in simulator but It's not appearing in Device it throwing run time error... 我可以在模拟器中看到iAd,但是它没有出现在设备中,提示运行时错误...

bannerView:didFailToReceiveAdWithError: The operation couldn't be completed. bannerView:didFailToReceiveAdWithError:该操作无法完成。 Ad inventory unavailable 广告资源不可用

how to resolve this error.??? 如何解决此错误。 Help me out..Thank you. 帮帮我..谢谢

One more interesting thing I have implemented iAd feature and when I am running my iPhone application on Device It's throwing error and as a result It's not showing iAd but when same application I am running in iPad It's running fine It's amazing for me can any one tell me why it happened? 我实现了iAd功能的另一件有趣的事情是,当我在设备上运行我的iPhone应用程序时,它抛出错误,因此没有显示iAd,但是当我在iPad中运行同一应用程序时,它运行良好,任何人都可以告诉我我为什么会这样?

Thank you. 谢谢。

There are number of threads on Stack Overflow that say that there isn't enough ad inventory to go around. Stack Overflow上有许多线程表明没有足够的广告资源可供使用。 In other words, even though you are asking for an ad, Apple doesn't have one to give you. 换句话说,即使您要广告,苹果也没有广告可以给您。 It's possible that there is a higher inventory for iPad ads available right now, because there are fewer iPad apps out there. iPad广告的库存可能会增加,因为iPad应用的数量减少了。

As for dealing with the error, make sure that your ViewController is implementing ADBannerViewDelegate and then put in the Apple recommended code to hide the ad when there is no ad, ie something like 至于处理错误,请确保您的ViewController正在实现ADBannerViewDelegate,然后放入苹果推荐的代码以在没有广告时隐藏广告,例如

#pragma mark -
#pragma mark ADBannerViewDelegate interface
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError
*)error{
    NSLog(@"%@",[error localizedDescription]);
    [banner setHidden:YES];
 }

// Handle ad loading // usualy set to show up in the view
- (void)bannerViewDidLoadAd:(ADBannerView
*)banner{    
    [banner setHidden:NO];
    NSLog(@"Ad visible");

} }

当情节提要中的iAd视图未链接到.h文件中的IBOutlet时,通常会出现此消息。

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

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