Android AdMob 错误代码 1 广告已展示

问题描述 投票:0回答:1

我在 AdMob 中遇到了一种新的错误。

广告正在展示,但在触发

onAdFailedToShowFullScreenContent
时我收到此错误。

{ "Code": 1, "Message": "The ad has already been shown.", "Domain": "com.google.android.gms.ads", "Cause": "null" }

有人知道这段代码背后的原因吗?我该如何处理?

android admob adsense
1个回答
0
投票

您需要确保在展示后处理您的广告,如下所示:

interstitialAd.fullScreenContentCallback = FullScreenContentCallback(
  onAdDismissedFullScreenContent: (ad) {
    print('onAdDismissedFullScreenContent');
    ad.dispose();
  },
  onAdFailedToShowFullScreenContent: (ad, error) {
    print('onAdFailedToShowFullScreenContent: $error');
  },
  onAdShowedFullScreenContent: (ad) {
    print('onAdShowedFullScreenContent');
  },
);
interstitialAd.show();

另外,下次展示之前不要忘记再次初始化。

© www.soinside.com 2019 - 2024. All rights reserved.