我使用此代码显示全屏广告,其中显示整页广告。问题是,当我关闭广告时,我只有一个空白屏幕。它不再显示我的应用程序了。
我的代码:
-(void)showFullScreenAd {
if (requestingAd == NO) {
interstitial = [[ADInterstitialAd alloc] init];
interstitial.delegate = self;
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[self requestInterstitialAdPresentation];
NSLog(@"interstitialAdREQUEST");
requestingAd = YES;
}
}
答案 0 :(得分:1)
找到解决方案。当广告关闭时,我只需要再次呈现我的视图控制器。我使用了以下代码:
-(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];
}