【问题标题】:iOS: full page interstitial ad shows black screen after closeiOS:整页插页式广告在关闭后显示黑屏
【发布时间】:2014-11-17 03:28:35
【问题描述】:

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

我的代码:

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

【问题讨论】:

  • 必须有更好的解决方案吗?我现在有同样的问题!
  • 我发布的解决方案一直对我有用,如果您找到更好的解决方案,请发布答案

标签: ios xcode iad interstitial


【解决方案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];

}

【讨论】:

  • 我在stackoverflow.com/a/31790963/455791 发表了关于这个问题的评论。简而言之,最好在新的 UIViewController 中展示广告,然后在广告结束后关闭该视图控制器。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-03-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多