iOS: full page interstitial ad shows black screen after close

隐身守侯 提交于 2020-01-04 04:38:27

问题


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.

My code:

-(void)showFullScreenAd {
    if (requestingAd == NO) {
        interstitial = [[ADInterstitialAd alloc] init];
        interstitial.delegate = self;
        self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
        [self requestInterstitialAdPresentation];
        NSLog(@"interstitialAdREQUEST");
        requestingAd = YES;
    }
}

回答1:


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];

}


来源:https://stackoverflow.com/questions/26965057/ios-full-page-interstitial-ad-shows-black-screen-after-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!