Swift - AdMob Rewarded Video - Can't Change Reward

189 views
Skip to first unread message

Andrea Marzoli

unread,
Nov 8, 2017, 2:40:08 AM11/8/17
to Google Mobile Ads SDK Developers

I've implemented ADMob Rewarded videos in my app. Everything works well and videos can be seen. The problem is that the reward obtained is always the default one "10 coins". I have set my APP and Ad Unit IDs correctly but can not change my reward in relation to what I've entered in AdMob UI

Can someone help me?


My Code


In App Delegate


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


In My Controller


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


On click of a Button


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


In My Callback Func


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


Screenshot





Joshua Lagonera (Mobile Ads SDK Team)

unread,
Nov 8, 2017, 4:26:30 AM11/8/17
to Google Mobile Ads SDK Developers
Hi Andrea,

It looks like you are getting ads from our Test Ad Unit IDs. When you add your device as a Test Device, it substitutes the Ad Unit ID used in the request with our Test Ad Unit IDs which may explain why you are getting the "default" reward value of "10 coins". If you want to test your Ad Unit ID if it is returning the correct rewards, try removing any test devices in your Ad Request.

Let me know if this works for you.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

Andrea Marzoli

unread,
Nov 8, 2017, 5:01:33 AM11/8/17
to Google Mobile Ads SDK Developers
Ok I understand. Now It Works.

But in this way I go against the admob policy because I do tests on a non-test device.

So I have to do the tests with the default APP ID knowing that when I release the app, I will find the right rewards.
Reply all
Reply to author
Forward
0 new messages