更新后 Google Ads SDK to 19.7.0
为 提供已弃用的警告消息InterstitialAd
, 而我搜索 this link解决问题但没有成功。
我该如何解决?
这是我的代码
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
Warning: There are many breaking changes coming in version 20.0.0. Version 19.7.0 introduces many new APIs, and deprecates or renames many classes in preparation for version 20.0.0. Please read the migration guide for more details on the changes.
https://developers.google.com/admob/android/migration
关于android - 更新后 Google Ads SDK 不推荐使用 InterstitialAd,如何解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65880741/