GADInterstitial splash dismiss with warning

时间:2013-10-22 09:45:28

标签: ios admob

我想在我的iOS游戏中添加GADInterstitial,所以每当应用程序变为活动状态时,我想要呈现兴趣。在我的AppDelegate.m中,在方法applicationDidBecomeActive中:我调用我的方法

-(void)splashInterstitial{
interestitial = [[GADInterstitial alloc] init];
interestitial.adUnitID = ADMOB_ID;
interestitial.delegate = self;
[interestitial loadAndDisplayRequest:[self createRequest] usingWindow:self.window   initialImage:nil];

}

但每次关闭广告时我都会收到警告:

attempt to dismiss modal view controller whose view does not currently appear. self = <GADInterstitialAppController: 0x5d3ed0> modalViewController = <GADWebAppViewController: 0x5d1ca0>

有没有人收到警告?

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。

之后,请始终检查您的横幅初始化和可视化
  

viewDidAppear

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    hasLoaded = YES;
    [self splashInterstitial];
}