更新GoogleAdsSDKInterstitialAd后被弃用,如何解决?

更新后Google Ads SDK to 19.7.0给出了一条已弃用的警告消息InterstitialAd,而我搜索此链接以解决问题但没有成功。我该如何解决?

这是我的代码

public void InterstitialAdmob() {
    mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId(Util.ADMOBINTER);
    mInterstitialAd.setAdListener(new AdListener() {
        @Override
        public void onAdClosed() {
            requestNewInterstitial();
        }
    });
    requestNewInterstitial();
}

protected void requestNewInterstitial() {
    AdRequest adRequest = new AdRequest.Builder().addTestDevice(ADMOBDEV).build();
    mInterstitialAd.loadAd(adRequest);
}
// for showing ads
 if (mInterstitialAd.isLoaded()) {
      mInterstitialAd.show();
   }

和开发者网站或建议

回答

在此处查看新的 API 示例:https :
//developers.google.com/admob/android/interstitial-fullscreen

警告:20.0.0 版中有许多重大更改。19.7.0 版引入了许多新 API,并弃用或重命名了许多类,为 20.0.0 版做准备。请阅读迁移指南以了解有关更改的更多详细信息。

https://developers.google.com/admob/android/migration


以上是更新GoogleAdsSDKInterstitialAd后被弃用,如何解决?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>