How to detect if a Chartboost rewarded video ad is over?

Hi there!

I have a question about using Chartboost rewarded video ads in my game!

How can I check to see if a rewarded video ad is done playing or over?

My video ad is working perfectly, however, I need to detect if the ad is done playing in order to trigger another event that needs to be called.

Thanks in advance!

-Max

Please continue the conversation here since its in the right forum. I’m going to lock the other.

I moved my answer to this thread:

Use the event listener.

local function listener( event ) if( event.type == "rewardedVideo" and event.phase == "closed" ) then -- skipped the ad elseif( event.type == "rewardedVideo" and event.phase == "reward" ) then -- watched the ad end return true end chartboost.init( { appID = appID, appSignature = appSignature, listener = listener } )

@roaminggamer is correct, however you should use event.response instead since event.phase is deprecated.

Too see a full list of chartboost events see:

https://github.com/swipeware/CoronaChartboostPlugin/blob/modernized/docs/init.markdown

Thanks for the correction @ingemar  I didn’t know the spec had changed and it looks like I need to update my personal code.  

-Cheers

@roaminggamer

It was easy to miss. The Chartboost docs hosted on Corona’s server specified the change, however my own docs on GitHub do not mention it as it was separate from Gremlin Interactive’s plugin. In January CoronaLabs told me they didn’t want the Chartboost docs on their servers and asked me to provide another means of providing my own docs, which I already had on GitHub.

Anyway there’s no urgency to change, as I have no intention to remove event.phase any time soon.

:slight_smile:

Please continue the conversation here since its in the right forum. I’m going to lock the other.

I moved my answer to this thread:

Use the event listener.

local function listener( event ) if( event.type == "rewardedVideo" and event.phase == "closed" ) then -- skipped the ad elseif( event.type == "rewardedVideo" and event.phase == "reward" ) then -- watched the ad end return true end chartboost.init( { appID = appID, appSignature = appSignature, listener = listener } )

@roaminggamer is correct, however you should use event.response instead since event.phase is deprecated.

Too see a full list of chartboost events see:

https://github.com/swipeware/CoronaChartboostPlugin/blob/modernized/docs/init.markdown

Thanks for the correction @ingemar  I didn’t know the spec had changed and it looks like I need to update my personal code.  

-Cheers

@roaminggamer

It was easy to miss. The Chartboost docs hosted on Corona’s server specified the change, however my own docs on GitHub do not mention it as it was separate from Gremlin Interactive’s plugin. In January CoronaLabs told me they didn’t want the Chartboost docs on their servers and asked me to provide another means of providing my own docs, which I already had on GitHub.

Anyway there’s no urgency to change, as I have no intention to remove event.phase any time soon.

:slight_smile: