4

Possible Duplicate:
how to display test IAd banner in the simulator

I have tried really hard, with several blogs and videos, to implement iAd in my application.

It still fails with

ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x610c5d0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}

and my adbannerview never displays.The error message makes me think that the view is present but not visible.

can any one please tell me why i am not able to see test advertisement in my simulator or device.

My code is posted in my old question but not much result: old post.

Please don't post links, I've read a lot and am implementing the same way but it wont work for me, so I think it is another issue. I checked proxy settings too, in case it was a networking issue.

Sorry to ask like this!

Community
  • 1
  • 1
ajay
  • 3,245
  • 4
  • 31
  • 59

3 Answers3

3

The ad has failed to load (that is why it wanted to call the missing didFailToReceiveAdWithError: delegate method). According to the docs, you are supposed to hide the view when you receive this error, so that the user doesn't have to stare at the ugly blank spot.

You can see what is the reason for the failed ad load if you implement the didFailToReceiveAdWithError: method and look at the error passed there. The most common cause is not enough inventory - it happens even with the test ads (to emulate real life I guess).

SVD
  • 4,743
  • 2
  • 26
  • 38
  • Thanks SVD.Then what ll be the solution for that error. – ajay May 10 '11 at 17:09
  • Do implement the didFailToReceiveAdWithError: method and see what the error says. If it says something specific, fix that. If it is "no inventory available", then there's nothing you can do about it. Note that the test ads may sometimes not show up - reboot the device or restart the simulator or move from the device to simulator or other way around. – SVD May 10 '11 at 17:39
  • sry for the trouble.I checked what you said above but none of them not worth for me.no result.i cross checked again with all the tutorials and videos i am doing same way still i am not getting test add.can you u help me on this farther more. – ajay May 11 '11 at 05:14
  • what does the error passed to didFailToReceiveAdWithError: say? – SVD May 11 '11 at 18:48
  • in that method i am getting below message ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x610c5d0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content} – ajay May 12 '11 at 05:31
  • "no delegate or delegate does not implement didFailToReceiveAdWithError:" - so you didn't actually implement it. Please do implement it and hide the banner if this happens. You won't get an ad for every request, sometimes (quite often actually - look up "fill rate") you won't get an ad. When that happens, you should hide the banner view in your didFailToReceiveAdWithError: implementation. – SVD May 12 '11 at 16:17
  • Thanks SVd i found solution.. – ajay May 12 '11 at 17:04
2

HI all finally i solved problem my self none of the blog didnt give any solution.I am not getting Test ad in the simulator it is coming in the device only by changing of the internal proxy settings.Its good experience for me and also my suggestion is while your operating with IOS device make sure to take proxy free device so that at least you can eliminate some of the issue related to proxy, dont forget to work proxy related stuff at the end product:)

Thanks for all of your great support.

ajay
  • 3,245
  • 4
  • 31
  • 59
  • This was exactly my problem as well. I was connected to wi-fi through a public hotspot and it must have been blocking the iAd service by a firewall or something. When I switched to tethering via my iPhone the test iAds loaded fine. – devios1 Jun 01 '14 at 19:10
0

Your error message doesn't indicate this in particular, but it's important to know that (in May 2011 when this answer was written) iAds are US-only, so as long as your device (or the simulator) thinks you're outside of the US you won't receive any ads.

Matthew Frederick
  • 22,245
  • 10
  • 71
  • 97
  • Thanks for your reply. how to check my app is working for Iad or not..But many blogs saying that test advertisement is available even outside the us also – ajay May 11 '11 at 07:33
  • @AAAAAAAAA You're right, if you're in test mode then you should get something. – Matthew Frederick May 11 '11 at 07:59
  • Thanks Matthew Frederick can you help me ou frm this – ajay May 11 '11 at 08:06
  • @AAAAAAAAA Does your view controller have the `` declared after its name in its interface file? It should look like `@interface YourViewControllerName : UIViewController ` -- replace "YourViewControllerName" with the actual name of your view controller, of course. – Matthew Frederick May 11 '11 at 08:35
  • yes,Even i tried like basic programe(helloworld) only didFailToReceiveAdWithError: delegate method is calling in that error message showing.The error message getting is shown above – ajay May 11 '11 at 09:00
  • @AAAAAAAAA Sorry, I don't know what the problem is. – Matthew Frederick May 11 '11 at 09:07
  • its k...thanks for your replay – ajay May 11 '11 at 09:34
  • Since when were iAds US-only? I have a UK app using iAds, all working fine. – a1phanumeric Sep 24 '12 at 14:32
  • @a1phanumeric From the time they were first released until about a year later. Note that this answer is 18 months old. It was completely correct at the time. – Matthew Frederick Sep 24 '12 at 18:10
  • @a1phanumeric I updated the answer by pointing out that the information was correct at the time. – Matthew Frederick Sep 24 '12 at 22:23
  • I know I'm 'erring' on the side of pedantic, but it was working in May 2011 in the UK. I believe Apple released iAd to the US around July 2010, then a few months after it came to the UK. – a1phanumeric Sep 25 '12 at 08:17
  • @a1phanumeric Fair enough. Ajay, the OP, is in India, so the result was the same. – Matthew Frederick Sep 26 '12 at 05:24