Hello!
my simple code always return 0 when I call ads.height() on Android.
main.lua:
local ads = require( "ads" ) local function adMobListener( event ) print( "Height in listener: "..ads.height()) end ads.init( "admob", "ca-app-pub-XXXXX", adMobListener ) ads:setCurrentProvider( "admob" ) ads.show( "banner", { x=0, y=0 } ) local height = ads.height() print("Local height: ",tostring( height))
build.settings
settings = { orientation = { default = "portrait", supported = { "portrait", } }, androidPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", }, plugins = { ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, }, }
I tested it on 2 devices (Samsung Galaxy S3 and Sony Xperia Z3 tablet)
and prints in android monitor are always the same:
09-30 01:53:32.421 32680-32705/? I/Corona﹕ Local height: 0 09-30 01:53:34.491 32680-32705/? I/Corona﹕ Height in listener: 0
Corona builds: 2015.2722 and 2015.2646
What do I do wrong? Could you give me a small example where ads.height() return something different from 0 on Android?