Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to implement didFailToReceiveAdWithError in iOS7+ app?

I'm implementing a new app for iOS7+. The integration with iAd banners seems easy with canDisplayBannerAds in the views i want to display a banner. However i'm getting this errors in Xcode log:

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}

Since in iOS7 iAd framework you only need to set canDisplayBannerAds = YES, is it necessary to continue doing Banner.delegate = self or implementing didFailToReceiveAdWithError?

Thanks in advance

like image 276
jorgeram Avatar asked Nov 10 '22 16:11

jorgeram


1 Answers

bannerView:didFailToReceiveAdWithError: is optional in ADBannerViewDelegate protocol (located in ADBannerView.h).

So all you need to do is set the Banner delegate and it should work well. Concerning canDisplayBannerAds property, the Apple Documentations states that it is:

A boolean value that indicates whether the view controller is configured to display banner ads.

So I don't think canDisplayBannerAds has anything to do with delegation. You should check that page from the Apple Documentation.

like image 130
AnderCover Avatar answered Nov 15 '22 05:11

AnderCover