interstitialWillDismissScreen仅被调用一次

时间:2016-07-12 01:58:59

标签: ios swift admob interstitial

我在快速项目中使用Admob插页式广告,但我无法重新加载广告。第一个插页式广告显示正常,当调用interstitialWillDismissScreen时,它会退回到游戏并重新加载新的插页式广告。但是,再次调用interstitialDidReceiveAd和interstitialWillDismissScreen,因此在显示第二个广告后,没有其他广告通过。我错过了什么?

client.get("http://api.randomuser.me/", function (data, response){
data = JSON.stringify(data.results);
console.log(data);
});"`

1 个答案:

答案 0 :(得分:1)

我假设loadAd()创建了一个新实例?您需要在新实例上设置委托:

func interstitialWillDismissScreen(ad: GADInterstitial!) {
    interstitial = loadAd()

    interstitial.delegate = self  // <-- You forgot this.

    print("loading new ad")
}

实际上你应该在loadAd()中设置委托,因为它是这个类的实例成员。