What's the proper way to credit user with coins for Rewarded Video?

Hi, all. 

 
I am developing for iOS and amusing the Appodeal plugin to display banner, interstitial and rewarded video ads.
 
In my Appodeal dashboard, I have a default placement and a placement called “highScoreScreen” that is for showing rewarded Videos. This all appears to be set up correctly.

However, my adListener never falls into the event.phase == “dataReceived” section (see code below). 

As an alternative, I use the event.phase == “playbackEnded” section to verify if a player has watched a rewarded video and then I award them coins. 

Although my alternative method seems to work, I’d like to know the official way of doing this.

Could someone share the appropriate way to credit a user after they watch a rewarded Video? 

The Appodeal example in GitHub doesn’t appear to show any code that rewards the player with coins after watching a rewarded video and my reading of the plugin documentation hasn’t helped. 

Thanks,

Teagen

local function adListener( event ) if ( event.phase == "init" ) then print( "Appodeal event: initialization successful" ) elseif ( event.phase == "loaded" ) then print( "Appodeal event: " .. tostring(event.type) .. " ad loaded successfully" ) elseif ( event.phase == "displayed" or event.phase == "playbackBegan" ) then print( "Appodeal event: " .. tostring(event.type) .. " ad displayed" ) --my code never falls into the "dataReceived" section elseif ( event.phase == "dataReceived" ) then print( "Appodeal event: " .. tostring(event.phase)) print( event.type ) print( event.data ) awardCoins(20) local alert = native.showAlert( "Reward Complete!", "You have received 20 coins", { "THANKS" } ) elseif ( event.phase == "hidden" or event.phase == "closed" or event.phase == "playbackEnded" ) then print( "Appodeal event: " .. tostring(event.type) .. " ad closed/hidden/completed" ) --this is my hack to award the user coins for watching a RewardedVideo if event.phase == "playbackEnded" and event.type == "rewardedVideo" then awardCoins(20) local alert = native.showAlert( "Reward Complete!", "You have received 20 coins", { "THANKS" } ) end elseif ( event.phase == "clicked" ) then print( "Appodeal event: " .. tostring(event.type) .. " ad clicked/tapped" ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( "Appodeal event: " .. tostring(event.type) .. " ad failed to load" ) end end

I have been using this code. Not sure which one is more correct.

if event.type == "rewardedVideo" and event.data.name == "reward" and event.phase == "playbackEnded" then -- reward here end

I have been using this code. Not sure which one is more correct.

if event.type == "rewardedVideo" and event.data.name == "reward" and event.phase == "playbackEnded" then -- reward here end