for iOS, iAd/AdMob mediation only works in viewDidLoad method. It completely ignores every other method. Since iAd is added through storyboards and AdMob is added programmatically, AdMob doesn't respond to .hidden statements. Since the mediation only works in ViewDidLoad, how do I make mediation work in -(void)GameOver method for example?
For example...
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{}
How Would I place the above method inside of the -(void)GameOver method so the code inside the didFailToReceiveAdWithError would work in -(void)GameOver?
-(void)bannerViewDidLoadAd:(ADBannerView *)banner{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0];
[iAdBanner setAlpha:1];
iAdBanner.hidden=NO;
[UIView commitAnimations];
[self.iAdBanner setDelegate:self];
bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0];
[iAdBanner setAlpha:0];
iAdBanner.hidden=YES;
[UIView commitAnimations];
bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
bannerView=[[GADBannerView alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
self.bannerView.adUnitID=@"Unit-ID";
self.bannerView.rootViewController=self;
[self.view addSubview:self.bannerView];
GADRequest *request =[GADRequest request];
request.testDevices= @[ GAD_SIMULATOR_ID ];
[self.bannerView loadRequest:request];
}