我需要在iOS7+应用程序中实现didFailToReceiveAdWithError吗



我正在为iOS7+实现一个新的应用程序。在我想要显示横幅的视图中,使用canDisplayBannerAds与iAd横幅的集成似乎很容易。然而,我在Xcode日志中得到了这个错误:

ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=7 "The operation couldn’t be completed. Ad was unloaded from this banner" UserInfo=0xc07bcc0 {ADInternalErrorCode=7, ADInternalErrorDomain=ADErrorDomain, NSLocalizedFailureReason=Ad was unloaded from this banner}

由于在iOS7 iAd框架中,您只需要设置canDisplayBannerAds=YES,是否需要继续执行Banner.delegate = self或实现didFailToReceiveAdWithError?

提前感谢

bannerView:didFailToReceiveAdWithError:ADBannerViewDelegate协议中是可选的(位于ADBannerView.h中)。

所以你所需要做的就是设置Banner代表,它应该能很好地工作。关于canDisplayBannerAds的属性,苹果文档指出它是:

一个布尔值,指示视图控制器是否配置为显示横幅广告。

所以我不认为canDisplayBannerAds与委派有任何关系。您应该从Apple文档中查看该页面。

最新更新