英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论