rewarded test ads show no ad config error in flutter

huangapple go评论71阅读模式
英文:

rewarded test ads show no ad config error in flutter

问题

我已经在清单中添加了权限和测试应用程序ID,但悬赏广告仍未加载,而横幅广告和插页广告已加载。是否有解决方案可以显示测试悬赏广告?

错误信息为:

"com.google.android.gms.ads"
message:
"No ad config."
英文:

I have added the permission and test app id in the manifest but still rewarded ad is not loading while the banner and interstitial were loaded. is there any solution how can I show the test rewarded ad

  RewardedAd? _rewardedAd;

  var adUnitId = 'ca-app-pub-3940256099942544/5224354917';

void loadAd() {
    RewardedAd.load(
        adUnitId: adUnitId,
        request: const AdRequest(),
        rewardedAdLoadCallback: RewardedAdLoadCallback(
          // Called when an ad is successfully received.
          onAdLoaded: (ad) {
            ad.fullScreenContentCallback = FullScreenContentCallback(
                // Called when the ad showed the full screen content.
                onAdShowedFullScreenContent: (ad) {},
                // Called when an impression occurs on the ad.
                onAdImpression: (ad) {},
                // Called when the ad failed to show full screen content.
                onAdFailedToShowFullScreenContent: (ad, err) {
                  // Dispose the ad here to free resources.
                  ad.dispose();
                },
                // Called when the ad dismissed full screen content.
                onAdDismissedFullScreenContent: (ad) {
                  // Dispose the ad here to free resources.
                  ad.dispose();
                },
                // Called when a click is recorded for an ad.
                onAdClicked: (ad) {});

            print('$ad loaded.');
            // Keep a reference to the ad so you can show it later.
            _rewardedAd = ad;
          },
          // Called when an ad request failed.
          onAdFailedToLoad: (LoadAdError error) {
            print('RewardedAd failed to load: $error');
          },
        ));
  }

The error is :

"com.google.android.gms.ads"
message:
"No ad config."

答案1

得分: 1

问题已解决,问题出在测试单元的激励广告ID,当使用真实ID时,它可以完美运行,不需要任何更改。

英文:

Problem is solved it was a problem with the test unit rewarded ad id when used real one it worked perfectly without any changes

huangapple
  • 本文由 发表于 2023年4月10日 18:39:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75976361.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定