简体   繁体   中英

Problem with iAd implementation?

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 application 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, ie 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");

}

当情节提要中的iAd视图未链接到.h文件中的IBOutlet时,通常会出现此消息。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM