I am having some trouble with my universal app and the iAd. It is working fine on iPhones and I am having some clicks and impressions etc. Every time I look at the app on my iPad, however, I see that it isn't working at all. The code that I have used for the iPad is exactly the same as the code for the iPhone so I'm not sure why it will show on one and not on the other.
iPadViewController.h
#import <iAd/iAd.h>
@interface iPadViewController : UIViewController <ADBannerViewDelegate, UIActionSheetDelegate>{
ADBannerView *adView;
BOOL bannerIsVisible;
}
@property (nonatomic,retain) IBOutlet ADBannerView *adView;
@property BOOL bannerIsVisible;
@end
iPadViewController.m
#import "iPadViewController.h"
@implementation iPadViewController
@synthes开发者_Go百科ize bannerIsVisible;
@synthesize adView;
-(void)bannerViewDidLoadAd:(ADBannerView *)banner{
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animateOn" context:NULL];
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
if(self.bannerIsVisible){
[UIView beginAnimations:@"animateOff" context:NULL];
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
I have added an iAd in the xib and linked it as adView.
Thanks in advance for any help.
The reason might be the different iOS versions in different devices you have. I have read that iAds is only supported in iOS 4. Your iPad might have iOS 3.
精彩评论