每次请求新广告时,我都必须销毁插页广告吗?

时间:2019-10-09 12:04:39

标签: c# unity3d game-development

我在其中一个教程中看到,他在请求新的插页广告之前销毁了插页式广告,对吗?下面是示例代码:

 private void RequestInterstitialAd()
{
    string interstitial_ID = "ca-app-pub-3940256099942544/1033173712"; // testid
    if (interstitialAd != null)
    {
        interstitialAd.Destroy();
    }
    interstitialAd = new InterstitialAd(interstitial_ID);
    interstitialAd.LoadAd(CreateNewRequest());
}

 public void ShowInsterstitialAd()
{
    if (interstitialAd.IsLoaded())
    {
        interstitialAd.Show();
    }
}

 private AdRequest CreateNewRequest()
{
    return new AdRequest.Builder().AddTestDevice("2077ef9a63d2b398840261c8221a0c9b").Build();
}

0 个答案:

没有答案