Swift - AdMob奖励视频 - 无法改变奖励

时间:2017-11-08 07:26:00

标签: ios swift admob

我已在我的应用中实施了ADMob Rewarded视频。一切运作良好,可以看到视频。问题是获得的奖励总是默认的" 10个硬币"。我已正确设置了我的APP和广告单元ID但无法更改我在AdMob UI中输入的奖励

有人可以帮助我吗?

我的代码

在App Delegate中

FirebaseApp.configure()
GADMobileAds.configure(withApplicationID: "ca-app-pub-3400090518055344~XXXMYAPPXXX")

在我的控制器中

let request = GADRequest()
request.testDevices = [ kGADSimulatorID, "dea0b09d6ea6594ab92XXXMyDEVICEXXX" ]
rewardBasedVideo = GADRewardBasedVideoAd.sharedInstance()
rewardBasedVideo.delegate = self
rewardBasedVideo.load(request, withAdUnitID: "ca-app-pub-3400090518055344/XXXMYUNITIDXXX")

点击按钮

if rewardBasedVideo.isReady == true {
    rewardBasedVideo.present(fromRootViewController: self)
}

在我的回调功能中

func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd,
                        didRewardUserWith reward: GADAdReward) {
    print("Reward received with currency: \(reward.type), amount \(reward.amount).")
}

截图

Screenshot My ADMob UI

Screenshot xCode Console

0 个答案:

没有答案