Vungle - Error in simulator with isAdAvailable (a nil value)

Hello!

Using the Vungle plugin, I find a run-time error in the simulator.

I attached an image to make the error appear.

However, when I compile, the app works correctly and shows ads.

Can you help me?

Ad libraries do not load on simulator so you will need to block ad calls when running on simulator

Ok!  thks!

The plugin should have stub files for the simulator though, which print something like “this plugin does not work in the simulator”.  

The problem here is actually that Vungle has removed the isAdAvailable call entirely, instead you have to track the “adPlayable” state for each ad placement in the plugin’s listener.

@Alan, there is no stub for that function and you actually have to step over it on sim.  I do

 --ads? if system.getInfo("environment") ~= "simulator" then allowAds = ads.isAdAvailable() if allowAds then print("ad available") else print("ad NOT available") end end

isAdAvailable is perfectly valid for v4.1 plugin - https://docs.coronalabs.com/plugin/vungle-v4/isAdAvailable.html

Ad libraries do not load on simulator so you will need to block ad calls when running on simulator

Ok!  thks!

The plugin should have stub files for the simulator though, which print something like “this plugin does not work in the simulator”.  

The problem here is actually that Vungle has removed the isAdAvailable call entirely, instead you have to track the “adPlayable” state for each ad placement in the plugin’s listener.

@Alan, there is no stub for that function and you actually have to step over it on sim.  I do

 --ads? if system.getInfo("environment") ~= "simulator" then allowAds = ads.isAdAvailable() if allowAds then print("ad available") else print("ad NOT available") end end

isAdAvailable is perfectly valid for v4.1 plugin - https://docs.coronalabs.com/plugin/vungle-v4/isAdAvailable.html