5

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

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
jorgeram
  • 141
  • 5
  • it needs to implement if you want some action or UI change when adview failed to receive ad. – Max Jul 25 '14 at 09:36

1 Answers1

1

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.

Szu
  • 2,254
  • 1
  • 21
  • 37
AnderCover
  • 2,488
  • 3
  • 23
  • 42
  • So to get that clear. I only need `@interface SViewController : UIViewController ` in *.h and `[self canDisplayBannerAds]` in *.m and that's it? because my app is not listed in the iAd network. Contract is made. And iAd is added to my apps. – Akaino Jul 24 '14 at 15:14
  • for the iAd network you might want to check on itunes connect or something. But in any case you have to set the delegate of your bannerView – AnderCover Jul 25 '14 at 09:29
  • I have done that and that was sort of logical in the end. But I can ignore the delegate methods, right? – Akaino Jul 25 '14 at 09:43
  • 1
    bannerView:didFailToReceiveAdWithError: is optional in ADBannerViewDelegate. So yes you can ignore it. It won't crash it it's not implemented – AnderCover Jul 25 '14 at 14:06
  • Thanks for you endurance with me! – Akaino Jul 25 '14 at 17:14