Help with AdMob

Can someone help me? The advertisements do not appear. When I open it in the simulator, I followed the two messages:

WARNING: The ‘ads’ library is not available on this platform.

WARNING: the ‘ads’ provider (admob) is not available on the simulator.

Then I tested in the smartphone. Also nothing appears. Could anyone help me? The stretch of the ads is this:

local ads = require( “ads” )

local adProvider = “admob”

local banner = “ca-app-pub-8498730568781592/82538*****”

local function adListener( event )

if ( ads.isLoaded(“interstitial”)) then

    ads.show(“interstitial”,{appId=banner,x=0,y=0})

    end

end

ads.load( “interstitial”, { appId=“banner”, testMode=false } )

ads.init( adProvider, banner, adListener )

First, ads do not work in the simulator. They only work on device.

You need to put some prints in your listener function and see what messages you get in adb logcat

Rob

I changed the function to display the error. But as you said, the simulator does not. But the android is not how I see the print as well. What to do?

local function adListener( event )

     local msg = event.response

     if (event.isError) then

           print(“Error, no ad received.”,msg)

     else

          print(“Ah ha! Got one!”)

    end

end

I’m not sure I understand your question. Are you wanting to know how to read the print messages from your device?

See: http://docs.coronalabs.com/guide/basics/debugging/index.html

First, ads do not work in the simulator. They only work on device.

You need to put some prints in your listener function and see what messages you get in adb logcat

Rob

I changed the function to display the error. But as you said, the simulator does not. But the android is not how I see the print as well. What to do?

local function adListener( event )

     local msg = event.response

     if (event.isError) then

           print(“Error, no ad received.”,msg)

     else

          print(“Ah ha! Got one!”)

    end

end

I’m not sure I understand your question. Are you wanting to know how to read the print messages from your device?

See: http://docs.coronalabs.com/guide/basics/debugging/index.html