PDA

View Full Version : help with iAds




cinek
Apr 29, 2011, 11:49 AM
I'm trying to implement iAds in my first app. But I'm getting this error message: ADBannerView: WARNING A banner view (0x620a390) has an ad but may be obscured. This message is only printed once per banner view.



the ad shows up for about a second or so, and dissapears. I have no idea what's wrong. I need it to display at the bottom of the screen. I have imported the framework & the iAd/iAd.h file in the header file. Here's the code I'm using:



@synthesize bannerIsVisible;

-(void)bannerViewDidLoadAd:(ADBannerView *)banner {

if(!self.bannerIsVisible){

[UIView beginAnimations:@"animateAdBannerOn" context:NULL];

banner.frame = CGRectOffset(banner.frame, 0, 280);

[UIView commitAnimations];

self.bannerIsVisible = YES;

}

}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {

if(self.bannerIsVisible){

[UIView beginAnimations:@"animateAdBannerOff" context:NULL];

//banner is visible - move it out of the screen due to a connection issue

banner.frame = CGRectOffset(banner.frame, 0, -280);

[UIView commitAnimations];

self.bannerIsVisible = NO;

}

}

//from view did load
banner = [[ADBannerView alloc] initWithFrame:CGRectZero];

banner.frame = CGRectOffset(adView.frame, 0, -280);

banner.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierLandscape];

banner.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;

[self.view addSubview:banner];

banner.delegate = self;

self.bannerIsVisible = NO;



Sykte
May 3, 2011, 12:24 AM
I'm trying to implement iAds in my first app. But I'm getting this error message: ADBannerView: WARNING A banner view (0x620a390) has an ad but may be obscured. This message is only printed once per banner view.



the ad shows up for about a second or so, and dissapears. I have no idea what's wrong. I need it to display at the bottom of the screen. I have imported the framework & the iAd/iAd.h file in the header file. Here's the code I'm using:



@synthesize bannerIsVisible;

-(void)bannerViewDidLoadAd:(ADBannerView *)banner {

if(!self.bannerIsVisible){

[UIView beginAnimations:@"animateAdBannerOn" context:NULL];

banner.frame = CGRectOffset(banner.frame, 0, 280);

[UIView commitAnimations];

self.bannerIsVisible = YES;

}

}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {

if(self.bannerIsVisible){

[UIView beginAnimations:@"animateAdBannerOff" context:NULL];

//banner is visible - move it out of the screen due to a connection issue

banner.frame = CGRectOffset(banner.frame, 0, -280);

[UIView commitAnimations];

self.bannerIsVisible = NO;

}

}

//from view did load
banner = [[ADBannerView alloc] initWithFrame:CGRectZero];

banner.frame = CGRectOffset(adView.frame, 0, -280);

banner.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierLandscape];

banner.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;

[self.view addSubview:banner];

banner.delegate = self;

self.bannerIsVisible = NO;



Take a look at the sample code for iAds. Sorry I don't have the link handy. It sounds like your not adjusting your other views properly.