我用这段代码显示全屏广告,它可以显示整页广告。问题是当我关闭广告时,我只有一个空白屏幕。它不再显示我的应用。
我的代码:
-(void)showFullScreenAd {
if (requestingAd == NO) {
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[self requestInterstitialAdPresentation];
NSLog(@"interstitialAdREQUEST");
requestingAd = YES;
}
}
最佳答案
找到解决方案。当广告关闭时,我只需要再次呈现我的 View Controller 。我使用了以下代码:
-(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:全页插页式广告关闭后显示黑屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26965057/