我在 AdMob 中遇到了一种新的错误。
广告正在展示,但在触发
onAdFailedToShowFullScreenContent
时我收到此错误。
{ "Code": 1, "Message": "The ad has already been shown.", "Domain": "com.google.android.gms.ads", "Cause": "null" }
有人知道这段代码背后的原因吗?我该如何处理?
您需要确保在展示后处理您的广告,如下所示:
interstitialAd.fullScreenContentCallback = FullScreenContentCallback(
onAdDismissedFullScreenContent: (ad) {
print('onAdDismissedFullScreenContent');
ad.dispose();
},
onAdFailedToShowFullScreenContent: (ad, error) {
print('onAdFailedToShowFullScreenContent: $error');
},
onAdShowedFullScreenContent: (ad) {
print('onAdShowedFullScreenContent');
},
);
interstitialAd.show();
另外,下次展示之前不要忘记再次初始化。