I am able to see iAd in simulator but It's not appearing in Device it throwing run time error...
bannerView:didFailToReceiveAdWithError: The operation couldn’t be completed. Ad inventory unavailable
how to resolve this error.??? Help me out..Thank you.
One more interesting thing I have implemented iAd feature and when I am running my iPhone applic开发者_StackOverflowation on Device It's throwing error and as a result It's not showing iAd but when same application I am running in iPad It's running fine It's amazing for me can any one tell me why it happened?
Thank you.
There are number of threads on Stack Overflow that say that there isn't enough ad inventory to go around. In other words, even though you are asking for an ad, Apple doesn't have one to give you. It's possible that there is a higher inventory for iPad ads available right now, because there are fewer iPad apps out there.
As for dealing with the error, make sure that your ViewController is implementing ADBannerViewDelegate and then put in the Apple recommended code to hide the ad when there is no ad, i.e. something like
#pragma mark -
#pragma mark ADBannerViewDelegate interface
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError
*)error{
NSLog(@"%@",[error localizedDescription]);
[banner setHidden:YES];
}
// Handle ad loading // usualy set to show up in the view
- (void)bannerViewDidLoadAd:(ADBannerView
*)banner{
[banner setHidden:NO];
NSLog(@"Ad visible");
}
Most often this message occurs when the iAd view in the storyboard is not linked to the IBOutlet in your .h file.
精彩评论