iOS 9 - Ad inventory unavailable

2020-04-06 03:48发布

问题:

After updating to Xcode 7 and building my app in iOS9, iAds stopped working and I get this error in bannerView

didFailToReceiveAdWithError:

Ad inventory unavailable.

Any ideas?

EDIT: iAds are now working. Apple must have fixed it after we filed bug reports on the issue.

回答1:

I am using Xcode 7.3.1 and I received the same error. After I renewed my membership I was able to click at the contracts,tax and banking information section. I saw that there wasn't a contract type for the iAd App Network anymore..only a contract type for paid applications. So my suggestion is that Apple does not support iAd anymore. In that case I would recommend to have a look on AdMob(Google Advertising).

Best regards, Nazar Medeiros



回答2:

You may have set an invalid (height) constraint for the ADBannerView. Please check the constraints for it.

In my case I had a wrong height constraint set in the storyboard scene. The height was set to 32 which is an invalid height for iPhone portrait mode. When I removed the bad constraint, the error ("Ad inventory unavailable") disappeared and the ads were delivered as before.

Likely the issue may appear as ads working on one device and not on another. (see iAd error: Ad Inventory unavailable) I assume that the constraints match valid ad dimensions on one device but do not match the valid dimensions on the other device and then ads only work on one device and not on the other.