Admob插页式广告 - 无法呈现插页式广告.还没有准备好

3 ads interstitial admob ios

此代码是否正确实施插页式广告?

在此输入图像描述

因为当我发射它时,我得到了这个,

<Google> Cannot present interstitial.  It is not ready.
Run Code Online (Sandbox Code Playgroud)

Rah*_*tel 22

您需要等到广告成功加载,然后才会出现插页式广告.否则广告就不会出现.

为此,请确认GADInterstitialDelegate协议并将视图控制器设置为interstitial_的委托.

interstitial_.delegate = self;
Run Code Online (Sandbox Code Playgroud)

然后执行interstitialDidReceiveAd如下.

- (void)interstitialDidReceiveAd:(GADInterstitial *)ad
{
    [interstitial_ presentFromRootViewController:self];
}
Run Code Online (Sandbox Code Playgroud)

有关更多参考,请查看插页式广告