iOS:整页非页内广告关闭后显示黑屏 [英] iOS: full page interstitial ad shows black screen after close
本文介绍了iOS:整页非页内广告关闭后显示黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用此代码显示了一个全屏广告,它可以显示一个完整的页面广告.问题是,当我关闭广告时,我只有一个空白屏幕.它不再显示我的应用了.
I show a full screen advertisement with this code, which works showing a full page advertisement. The problem is that when I close the advertisement I just have a blank screen. It does not show my app anymore.
我的代码:
-(void)showFullScreenAd {
if (requestingAd == NO) {
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[self requestInterstitialAdPresentation];
NSLog(@"interstitialAdREQUEST");
requestingAd = YES;
}
}
推荐答案
找到了解决方案.广告关闭后,我只需要再次显示我的视图控制器即可.我使用了以下代码:
Found a solution. I just needed to present my view controller again when the advertisement had been closed. I used the following code:
-(void)interstitialAdActionDidFinish:(ADInterstitialAd *)interstitialAd {
interstitial = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidFINISH");
// present my view controller again
ViewController *myVC = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
[self presentViewController:myVC animated:YES completion:nil];
}
这篇关于iOS:整页非页内广告关闭后显示黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文