10

I'm adding iAd to my app. Now, in simulator, it works well but when I load it on a device (v4.1) the ADBannerViewDelegate calls bannerView:didFailToReceiveAdWithError: with this description on the error.userInfo

{
    ADInternalErrorCode = 3;
    NSLocalizedFailureReason = "Ad inventory unavailable";
}

I think my iAd Network setup is correct. Have I to add an ad by myself or iAd Network automatically sends test ads as in simulator?

EDIT: I think it was a latency problem of the iAd Network server that dispatches the ads. I suppose that when the network had ads for my app it began to work fine.

Stu Thompson
  • 38,370
  • 19
  • 110
  • 156
emenegro
  • 6,901
  • 10
  • 45
  • 68

7 Answers7

5

if you running with a development certificate you will only get test ads even when running on a device. From the iAd Programming Guide:

While you are developing your application, iAd Network sends test advertisements to your application. To assist you in validating your implementation, the iAd Network occasionally returns errors to test your error handling code. You can also test your error handling support by turning your device’s wireless capability off.

So you should see the test Ad on the device but you will never see a real live ad.

Vincent Gable
  • 3,455
  • 23
  • 26
kharrison
  • 3,412
  • 1
  • 24
  • 19
  • 4
    Thanks, kharrison, I already read it. The problem is that I don't see nor real or test ads, nothing, it always returns that error :( – emenegro Sep 15 '10 at 21:18
  • did you enable your app for iAds with iTunes Connect? I assume you did if you are seeing tests ads in the simulator. Also does your device have network connectivity? – kharrison Sep 15 '10 at 22:11
  • 1
    It was all ok, kharrison. Maybe I missed something on ITC but know it works without aditional programming or configuration. I supose it was a "lag" issue. Thank you very much for your help. – emenegro Sep 16 '10 at 06:03
3

It was a latency problem of the iAd Network server that dispatches the ads. I suppose that when the network had ads for my app it began to work fine.

emenegro
  • 6,901
  • 10
  • 45
  • 68
  • This was my problem as well. After having waited (goggled the problem and wound up here) for about 30 seconds the test-ad suddenly appeared. – Gjermund Bjaanes Jan 06 '15 at 21:06
3

Yes, Removing app from device and rebuilding solved it in my case.

iartigas
  • 31
  • 1
  • This answer is a lot better than the selected one which is not an actual answer but a wish of the user that thinks that things will get better in the future.:-) – Pacu Dec 14 '14 at 18:26
2

According to the ADBannerView class reference of Apple's documantation iOS Developer Library:

enum {
ADErrorUnknown = 0,
ADErrorServerFailure = 1,
ADErrorLoadingThrottled = 2,
ADErrorInventoryUnavailable = 3,
ADErrorConfigurationError = 4,
ADErrorBannerVisibleWithoutContent = 5,
ADErrorApplicationInactive = 6
};
typedef NSUInteger ADError;

//ADErrorInventoryUnavailable
//Indicates that no advertisements are currently available to download.
//Available in iOS 4.0 and later.
//Declared in ADBannerView.h.

Therefore it is an exception caused by the server side of the iAd; not the code itself.

mcy
  • 1,209
  • 6
  • 25
  • 37
2

After this did not work for me, deleting the app from the device and doing a clean build did.

steve
  • 2,381
  • 1
  • 13
  • 2
2

Just an additional update, running ad testing on my IPAD I got this error suddently, after banging my head (as others have done) for a while I noticed the time on the IPAD was 8 mins out, both were set on auto but still 8 mins difference, set the IPAD clock manually and error went away!.

Hope this helps someone.

Tim Teece
  • 21
  • 1
1

For the last 5 days I've been having the same issue. I was getting a valid response before that and the bannerViewDidLoadAd delegate method was been called. Maybe there is something on apple's side? I didn't find anything that implies that, but it's my guess

Francisco
  • 11
  • 1