gpt4 book ai didi

iOS:全页插页式广告关闭后显示黑屏

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:16:51 24 4
gpt4 key购买 nike

我用这段代码显示全屏广告,它可以显示整页广告。问题是当我关闭广告时,我只有一个空白屏幕。它不再显示我的应用。

我的代码:

-(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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com