I have an iAd which shows up fine when connected to the Network. On the iOS simulator or testing on my device, if I open up my app, see the iAd, then go to settings and turn on airplane mode, and return to the app, the banner slide off the screen. Great. Now, if I turn airplane mode back off (network is ON), the iAd doesn't reappear - even after waiting for 10-15 minutes.
So, here are my questions:
Does the iAd Test Advertisement refresh itself the same as a real iAd would (every minute or so)?
Is there a way to force the iAd to refresh and request a new ad when the network is detected?
I just can't find information on the behaviour of the Test Ads anywhere, and I can't test with real Ads until I upload the app to the App Store (right?)
Heres my code:
Where the iAd is created:
- (void)viewDidLoad
{
adView = [[ADBannerView alloc] initWithFrame:CGRectMake(0, 410, 320, 50)];
adView.frame = CGRectOffset(adView.frame, 0, 50);
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:adView];
adView.delegate=self;
self.bannerIsVisible=NO;
[super viewDidLoad];
}
And the delegate methods:
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
NSLog(@"AdWin");
if (!self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, -50);
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
NSLog(@"AdLose");
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, 50);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
The delegate method NSLog
calls only appear once - not every minute, like I would expect if the Ad was getting refreshed.