How do the AdMob Listeners for SDKBox for Cocos Creator work?

This question in regards to Cocos Creator.

So there are a few ways to set up AdMob listeners through SDKBox as described in the official Cocos Creator Documentation.

While I’ve had no problem integrating actual ads into my Android Application, I’m having a ton of trouble navigating through the Listeners and figuring out how they work. The available listeners are:

  • adViewDidReceiveAd(name)
  • adViewDidFailToReceiveAdWithError(name, msg)
  • adViewWillPresentScreen(name)
  • adViewDidDismissScreen(name)
  • adViewWillDismissScreen(name)
  • adViewWillLeaveApplication(name)

Here are my problems:

  1. What do each of these listeners do exactly? I found an explanation on the Google Ads Developer Blogs which answers that question to an extent. But I didn’t find it completely clear, especially since I’m using the iOS callbacks for some reason while developing for Android and they don’t really tell you the difference between WillDismissScreen() and DidDismissScreen() except that the first is called before the ad is closed and the second after the ad is closed.

  2. I’m calling a rewarded video ad, and as of natural consequence, I want the user to watch through the entire video before they can get their reward. However, (I) the user gets the reward whether or not they have watched through the entire rewarded video and that’s probably because I’m giving them the rewards in WillPresentScreen(). But, (II) which listener should I use if I want to determine whether or not they have watched through the entire ad? Is it DidDismissScreen() or WillDismissScreen()?

those events are came from admob, you can check admob’s document.

Not exactly the same, basically kept the same. and keep android/iOS use the same listener.

reward video event:

  • reward(const std::string &name, const std::string &currency, double amount)

if you want to reward, you should use the reward event.

Sorry for not clearing it before, but I’m using Cocos Creator, not 2d-x.

Thanks for your help, but I don’t see any reward function as such. I’m currently calling rewarded videos using the function"rewarded");

which is working just fine. I can see the ad but there is no way to tell whether the user watched the rewarded video or closed it mid way.

js API is the same as cpp.

reward: function(name, currency, amount)

Thanks for the help!

But it seems that it is mostly a reward mechanism more than anything to check whether the rewarded video is fully watched or not.

I just tried it in my project and it doesn’t seem to be a listener of any sort which gets called in certain conditions?
Perhaps I’ll have to configure the callback through the AdMob dashboard for it to work, but as of right now, it’s not really triggering any listeners or even executing the extra code placed inside the listener function for that matter.

the reward event is for admob’s reward ad. it will trigger when following event occur.