How to test "ads" plug in ?

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.

InMobi has a low fill rate, there may not be ads to get.  Put some prints in your listener and see what data you’re getting back in your event table.

thanks for your reply @@ however: 1. it seems that the simulator do not support “ads” library, i get error msg of that. so i think print the adlistener will not return anything in the simulator? or i should use the newest mac version corona? 2. seems admob still have some problem? i cant even build the apps if i use admob. i will post the build error msg out once i return home.

None of our supported ad vendors will work in the Corona SDK simulator.  They all have to be tested on the device.  The code is “stubbed out” in the simulator, so the function calls won’t stop your app from working, but they do no work, so your listener will not be called in the simulator.

InMobi has a low fill rate, there may not be ads to get.  Put some prints in your listener and see what data you’re getting back in your event table.

thanks for your reply @@ however: 1. it seems that the simulator do not support “ads” library, i get error msg of that. so i think print the adlistener will not return anything in the simulator? or i should use the newest mac version corona? 2. seems admob still have some problem? i cant even build the apps if i use admob. i will post the build error msg out once i return home.

None of our supported ad vendors will work in the Corona SDK simulator.  They all have to be tested on the device.  The code is “stubbed out” in the simulator, so the function calls won’t stop your app from working, but they do no work, so your listener will not be called in the simulator.