Dear all,
I just want to test if the ads plugin work.
I follow the ads implementation guide.
Firstly, I add these codes inside the build.settings:
android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”,
“android.permission.READ_PHONE_STATE”,
},
},
plugins =
{
– key is the name passed to Lua’s 'require()'
[“CoronaProvider.ads.inmobi”] =
{
– required
publisherId = “com.coronalabs”,
},
},
and then, in the main.lua, i have added:
local ads = require(“ads”)
local function adListener(event)
if event.isError then
print(“fail to receive ads”)
end
end
ads.init( “inmobi”, “myAppId”, adListener ) – as i haven’t published the apps yet, i don’t have the apps id, should i change it with anything here?
----------------------------------------------------------------------------------
I use storyboard and my main.lua link to adstest.lua, inside adstest.lua, I have added:
local ads = require(“ads”)
ads.show( “banner320x48”, { x=_W, y=_H, interval=60, testMode=true} ) –_W and _H is screen width and height, i changed the testMode to true…is this correct?
-----------------------------------------------------------------------------------
the apps can be built. However, after I installed it in my android device, nothing show up. I just want to test the ads function, am I suppose to see some testing ads show up??? or should I have a real AppID?
Thanks.