I am trying to implement the NavigationBanner
iAdSuite
example into my project so that a I can share a single AdBannerView
instance across multiple view controllers, but I keep getting the following error:
Error Domain=ADErrorDomain Code=2 "The operation couldn’t be completed. Loading throttled
I have copied the relevant code exactly from the current iAdSuite into my own app and am getting this error. In fact, this error is repeatable in Apple's own iAdSuite example for NavigationBanner (which is the example I am trying to implement). The error can be seen by adding:
NSLog (@"%@",error);
to:
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
To replicate the problem in iAdSuite
do the following:
- Turn your device Airplane mode to On
- Launch iAdSuite NavigationBanner from Xcode. This generates an error right away "ADErrorDomain error 1".
- Exit the app by pressing the Home button on your device, then turn Airplane mode Off.
- Re-launch NavigationBanner by tapping the icon, and the error appears.
This is a problem for my application because I want to hide the iAd if there is no connectivity, and then have it re-appear once connectivity resumes. If the app receives the throttling error, then there will be a long delay before it can receive another ad.
How can the throttling error be avoided? I was thinking that the bannerView needs to be removed and then re-added, but could not figure out how to do this correctly.
One last thing to note is that the current iAdSuite uses ARC while my application does not. Even so, the error occurs with both my app and iAdSuite.