How to track whether a player has finished watching a reward video (appodeal)

I need to track if player watched ads or not

All ad providers should trigger your ad event listener function when ad views are complete. You have to use that listener function to react to the events send by the ad plugin.

Rob

And how to do it? I know that the Appodeal plugin has adsRequest for the listener. It sounds stupid, but I don’t know how to arrange it :stuck_out_tongue: .I be very thank if you help me

This tutorial, while using AdMob for most of its code, discusses everything you need to know about implementing ads. Don’t get stuck on the code, all the Ad providers are basically the same. 

http://docs.coronalabs.com/tutorial/basics/ads/index.html

Then look at the event.phase information for Appodeal which is part of the adRequest event:

http://docs.coronalabs.com/plugin/appodeal/event/adsRequest/phase.html

you will see “displayed” or “playbackEnded” as a couple of possible event.phase options that you can get when a video is finished. You will have to put some print code in your event listener function, test the various playback options (stopping ads early, letting them play, seeing the difference between rewarded video or interstitial video is handled.

Rob

This is what I use but i agree even with my code you should test it and see if it fits your need.

I reward when these conditions are met in the call back. I noticed in the latest documentation that the event.data.name property is not listed, but this still works as a few days ago on build 3520 and using the appodeal beta.

event.data ~= nil and event.type == "rewardedVideo" and event.data.name == "reward" and event.phase == "playbackEnded"

Thank , this really work!