我正在尝试在我的颤振应用中展示奖励视频广告。有时它工作得很好,有时我得到这个错误“PlatformException(ad_not_loaded,奖励视频显示失败,没有加载广告,null)”
以下是我加载和展示广告的方式:
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
testDevices: ['6E85178A5E7B957403B497917D014D74'],
);
try {
await RewardedVideoAd.instance.load(
adUnitId:getRewardBasedVideoAdUnitId(), targetingInfo: targetingInfo);
await RewardedVideoAd.instance.show();
} on PlatformException catch (e) {
Fluttertoast.showToast(
msg: AppStrings.adFailed,
toastLength: Toast.LENGTH_LONG,
timeInSecForIosWeb: 5,
);
}
通常这种情况发生在广告成功然后下一次失败以及成功后的时间等等,也许我需要在广告成功显示后重置一些东西?