/**
* Triggered when an video reward is completed.
* @memberOf Cocoon.Ad.Interstitial
* @event On reward
* @example
* interstitial.on("reward", function(reward, error){
* if (reward && reward.amount > 0) {
* console.log("Reward completed. Earned " + reward.amount + " items");
* }
* });
*/
On Android the error parameter is empty when the video has been fully watched, or it's a string when user canceled the video. This way we can check in code whether we should reward the user or not. And that is awesome.
The problem is that the same code on iOS works differently. The error parameter is empty no matter if the video was canceled or not. This means it's not possible to check whether we should reward a user or not.
Could you please take a look at the iOS code? It looks like some small issue... a typo possibly?
BTW: The reward parameter (tested on Android) is not an object and does not have the .amount member. It's simply a string so it is no use here.
This is the sample code from cocoon_ads.js
On Android the error parameter is empty when the video has been fully watched, or it's a string when user canceled the video. This way we can check in code whether we should reward the user or not. And that is awesome.
The problem is that the same code on iOS works differently. The error parameter is empty no matter if the video was canceled or not. This means it's not possible to check whether we should reward a user or not.
Could you please take a look at the iOS code? It looks like some small issue... a typo possibly?
BTW: The reward parameter (tested on Android) is not an object and does not have the .amount member. It's simply a string so it is no use here.
Thanks