ludei / atomic-plugins-ads

Atomic Plugins for Ads
http://atomic-plugins.com/
Mozilla Public License 2.0
18 stars 22 forks source link

Rewarded Video triggers "success" even if canceled on iOS #14

Open TobyReeno opened 6 years ago

TobyReeno commented 6 years ago

This is the sample code from cocoon_ads.js

        /**
         * 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.

Thanks