How do you know if a Vungle ad has loaded?

I’m using build 3565 and the Vungle 5 api.   The load method doesn’t return anything, nor does there appear too be an ad listener event type or phase that gets trigged on a successfully loaded ad.

How can you tell if it worked before you display a black screen?

If you need help with code related issues, you should show what you’ve tried so far.

Have you tried inserting the following loop inside the listener and seeing what pops out?

for i, j in pairs ( event ) do print( i, j ) end

I’m echoing the event type and phase in the listener now, will do that next.   

It would help if the docs were a little more informative, too.

https://docs.coronalabs.com/plugin/vungle/index.html

Based on the docs that you linked, I would expect that what you are looking for is the “isAdPlayable” property. Did you try that?

Those docs are usually very old in my code. I check for three values on the event:

if event.type == "adAvailable" and event.isAdPlayable == true then if event.placementID == \<yourPlacementForInterstitial\> then interstitialAvailable = true -- store it in a variable. end end

The new documentation can be found on vungle’s site. They update the plugin but do not update the docs on the site:

https://support.vungle.com/hc/en-us/articles/360003413891-Get-Started-with-Vungle-SDK-v-6-Corona

Very helpful (especially the Vungle docs), marking as Solved.   Thanks everyone.

Isnt corona plugin v5 and that vungle doc is for v6?

No. There is no other plugin. The is only one plugin and it is version 6 (currently). Vungle manages / updates their own plugin. Not sure why they never bother updating the corona documentation, but they do update their site documentation.

Both documentation on the corona site (v5) and vungle site (v6) state to add the plugin you should. So unless there is some magic it just downloads v6:

plugins = { ["plugin.vungle"] = { publisherId = "com.vungle" }, },

The corona site (v4) is different:

plugins = { ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle" }, },