I'm using AdMob
as backup for iAd
, but I'm having trouble finding out if AdMob
delivers..
With iAd
I could check with isBannerLoaded
or something, but not with AdMob
..
Anyway, I've got everything working now, except when theres no internet connection!
When iAd
fails to load an ad, and calls didFailToReceiveAdWithError
, then I initiate the AdMob
. When testing this, the Error-reason I'm using is "no internet connection", but AdMob doesn't call it's own didFailToReceiveAdWithError
. It seems like no internet connection isn't an error for AdMob (GADBannerView*
)
How can I tell if GADBannerView fails?
EDIT
Okay, so here's basically code I have:
-(void)viewDidLoad
{
[super viewDidLoad];
[self initiAdBanner];
[self initAdMobBanner];
}
-(void)initAdMobBanner{}//initiates variable adMobBannerView(GADBannerView)
-(void)initiAdBanner{}//initiates variable iAdBannerView(ADBannerView)
-(void)hideBanner:(UIView*)banner{} //hides banner if visible
-(void)showBanner:(UIView*)banner{} //shows banner if hidden
//blah blah
-(void)adView:(GADBannerView*)banner didFailToReceiveAdWithError:(GADRequestError*)error
{
//Never gets called, should be called when both iAd and AdMob fails.
NSLog(@"AdMobBanner failed.");
[self hideBanner:banner];
}
-(void)bannerView:(ADBannerView*)banner didFailToReceiveAdWithError:(NSError*)error
{
//If iAd fails, due to no internet connection or whatever, then it calls this.
[self adMobRequest];
[self hideBanner:iAdBannerView];
[self showBanner:adMobBannerView];
}
When iAd fails and calls for (ADBannerView*)didFailToReceiveAdWithError
, I start the AdMob, but when theres no internet connection, the AdMob won't call the (GADBannerView*)didFailToReceiveAdWithError
.
Why?