From 782d970f785fd3cb3bfe4fbfdb479089b9aa2869 Mon Sep 17 00:00:00 2001 From: Jeff Haynie Date: Mon, 5 Jul 2010 12:10:31 -0700 Subject: [PATCH] per apple, we must hide the iAd if no ads are available --- iphone/Classes/TiUIiOSAdView.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iphone/Classes/TiUIiOSAdView.m b/iphone/Classes/TiUIiOSAdView.m index 86dcd2a775b..905b7ee2b67 100644 --- a/iphone/Classes/TiUIiOSAdView.m +++ b/iphone/Classes/TiUIiOSAdView.m @@ -116,6 +116,9 @@ - (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication: - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error { + // per Apple, we must hide the banner view if there's no ad + [self.proxy replaceValue:NUMBOOL(NO) forKey:@"visible" notification:YES]; + if ([self.proxy _hasListeners:@"error"]) { NSMutableDictionary *event = [NSMutableDictionary dictionary];