didFailToReceiveAdWithError não está funcionando para simuladores do iOS 8
Minha mediação do iAd / AdMob funciona bem com todos os simuladores e dispositivos do iOS 7. No entanto, o método didFailToReceiveAdWithError do iOS 8 não funciona em nenhum simulador, mas funciona em dispositivos iOS 8. O problema é que não tenho um dispositivo iPhone 6/6 + para testar. Então, eu estou contando com o simulador do iOS 8.
-(void)bannerViewDidLoadAd:(ADBannerView *)banner{
[UIView beginAnimations:nil context:NULL];
iAd.frame=CGRectOffset (iAd.frame 0, -667);
[UIView commitAnimations];
[UIView beginAnimations:nil context:NULL];
iAd.frame=CGRectOffset (iAd.frame 0, 0);
[UIView commitAnimations];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
[UIView beginAnimations:nil context:NULL];
iAd.frame=CGRectOffset (iAd.frame 0, -740);
[UIView commitAnimations];
[UIView beginAnimations:nil context:NULL];
AdMob.frame=CGRectOffset (iAd.frame 0, -667);
[UIView commitAnimations];
}
Nem sei se as coordenadas didFailToReceive estão corretas, pois não tenho como testar. Não entendo por que didFailToReceiveAdWithError nunca é chamado apenas para simuladores do iOS 8? Este é um erro do simulador do iOS 8 ou há algo que eu possa fazer para corrigir esse problema?
// ignorar ^^
-(AppDelegate *)appdelegate{
return (AppDelegate *) [[UIApplication sharedApplication] delegate];
}
-(void)viewWillAppear:(BOOL)animated{
//iAD
_iAdView= [[self appdelegate] iAdView];
_iAdView.delegate=self;
screenBounds = [[UIScreen mainScreen] bounds];
[_iAdView setFrame:CGRectMake(0, 0, _iAdView.bounds.size.width, _iAdView.bounds.size.height)];
_iAdView.center = CGPointMake(screenBounds.size.width / 2, screenBounds.origin.y + (_iAdView.bounds.size.height / 2));
[self.view addSubview:_iAdView];
//ADMOB
_adMobView= [[self appdelegate] adMobView];
_adMobView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
_adMobView.adUnitID = @"My-Unit-ID";
_adMobView.rootViewController = self;
GADRequest *request =[GADRequest request];
request.testDevices = @[ @"Test-Number" ];
[_adMobView loadRequest:request];
[_adMobView setFrame:CGRectMake(0, 0, _adMobView.bounds.size.width, _adMobView.bounds.size.height)];
_adMobView.center = CGPointMake(screenBounds.size.width / 2, screenBounds.size.height - (_adMobView.bounds.size.height / 2));
[self.view addSubview:_adMobView];
}
-(void)viewWillDisappear:(BOOL)animated{ //Whether I remove this or not, nothing changes
//iAD
_iAdView.delegate = nil;
_iAdView=nil;
_iAdView.alpha=0.0;
//ADMOB
_adMobView.delegate=nil;
_adMobView=nil;
_adMobView.alpha=0.0;
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner{
NSLog(@"iAd received");
_iAdView.alpha=1.0;
_adMobView.alpha = 0.0;
[UIView commitAnimations];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
NSLog(@"iAd failed, AdMob received");
_iAdView.alpha=0.0;
_adMobView.alpha=1.0;
[UIView commitAnimations];
}