iAd 实施有问题吗?

发布于 2024-11-02 19:47:35 字数 272 浏览 3 评论 0原文

我可以在模拟器中看到 iAd,但它没有出现在设备中,它会抛出运行时错误...

bannerView:didFailToReceiveAdWithError:操作无法完成。广告库存不可用

如何解决此错误。???帮帮我吧..谢谢。

另一件有趣的事情是,我实现了 iAd 功能,当我在设备上运行 iPhone 应用程序时,它会抛出错误,因此它不会显示 iAd,但当我在 iPad 上运行同一个应用程序时,它运行良好,这对我来说太神奇了,谁能告诉我我为什么会这样?

谢谢。

I am able to see iAd in simulator but It's not appearing in Device it throwing run time error...

bannerView:didFailToReceiveAdWithError: The operation couldn’t be completed. 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?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沙沙粒小 2024-11-09 19:47:35

Stack Overflow 上有许多线程表示没有足够的广告库存可供使用。换句话说,即使你要求广告,苹果也不会给你广告。目前可用的 iPad 广告库存可能较高,因为 iPad 应用程序较少。

至于处理错误,请确保您的 ViewController 正在实现 ADBannerViewDelegate,然后放入 Apple 推荐的代码以在没有广告时隐藏广告,即类似

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

}

There are number of threads on Stack Overflow that say that there isn't enough ad inventory to go around. 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.

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, i.e. something like

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

}

梅窗月明清似水 2024-11-09 19:47:35

大多数情况下,当故事板中的 iAd 视图未链接到 .h 文件中的 IBOutlet 时,会出现此消息。

Most often this message occurs when the iAd view in the storyboard is not linked to the IBOutlet in your .h file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文