Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

ads.isAdAvailable() not working
Started by Daniel W. Feb 22 2014 08:48 PM

2 replies to this topic
[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

Daniel W.

[GLOBAL: userInfoPane.html]
Daniel W.
  • Contributor

  • 249 posts
  • Corona SDK

I've used Vungle before and I've successfully built in Vungle ads. However, after using the latest public build, the ads.isAdAvailable() is no longer working. Anyone else run into this issue?

 

Here's the doc site - http://docs.coronalabs.com/daily/plugin/vungle/isAdAvailable.html - and the code.

 

-- name of the Vungle 'ads' provider
local provider = "vungle"

-- replace with your own Vungle application ID
local appId = "vungleTest"

-- load Corona 'ads' library
local ads = require "ads"

-- initialize the 'ads' library using Vungle as the provider and without the optional 3rd parameter 'listener'
ads.init( provider, appId )

-- if a cached video ad is available for display
if ads.isAdAvailable() then
    -- show the ad (without the optional 2nd 'params' table)
    ads.show( "interstitial" )
end
 

 

 



[TOPIC: post.html]
#2

Dmytriy

[GLOBAL: userInfoPane.html]
Dmytriy
  • Observer

  • 1 posts
  • Corona SDK

I also have the same problem. Simulator gives an error: isAdAvailable is a nil value



[TOPIC: post.html]
#3

ingemar

[GLOBAL: userInfoPane.html]
ingemar
  • Corona Geek

  • 2,733 posts
  • Enterprise

This is most likely due to a missing simulator stub in the latest builds.

 

Most ad networks don't work in the simulator anyway, so I've put a "switch" in my code that ignores all ad network calls when running in the Corona Simulator. That way you never get these errors.

 

ads.isAdAvailable() works on device.




[topic_controls]
[/topic_controls]