Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Vungle - Error in simulator with isAdAvailable (a nil value)
Started by leonardohuarita Jun 13 2017 06:25 AM

4 replies to this topic
vungle error isadavailable
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

leonardohuarita

[GLOBAL: userInfoPane.html]
leonardohuarita
  • Observer

  • 8 posts
  • Corona SDK

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?

Attached Files



[TOPIC: post.html]
#2

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 1,959 posts
  • Corona SDK

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



[TOPIC: post.html]
#3

leonardohuarita

[GLOBAL: userInfoPane.html]
leonardohuarita
  • Observer

  • 8 posts
  • Corona SDK

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

Ok!  thks!



[TOPIC: post.html]
#4

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 888 posts
  • Corona SDK

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.



[TOPIC: post.html]
#5

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 1,959 posts
  • Corona SDK

@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




[topic_controls]
[/topic_controls]