AdMob error

Hi, I’m trying to add admob banner into my game.

Start of main.lua

local storyboard = require("storyboard") storyboard.purgeOnSceneChange = true   ads = require "ads"   local function adListener( event )     if event.isError then             local alert = native.showAlert( "error", "error", { "ok" } )     end end   ads.init( "admob", "my\_key\_is\_here", adListener )

build.settings:

    android =

    {

        usesPermissions =

        {

            “android.permission.INTERNET”

        },

    },

    plugins =

    {

        – key is the name passed to Lua’s ‘require()’

        [“CoronaProvider.ads.admob”] =

        {

            – required

            publisherId = “com.coronalabs”,

        },

    }, 

and on scene I call this:

ads.show( “banner”, { x=centerX, y=screenBottom - 50, testMode=true } )

And I’m getting “error” message, but can’t debug where’s a problem.

What is the error and what is the line of code where the error is happening?

Rob

Error is happening when I’m trying to show an ad. The problem is I don’t know what an error is. Just the event is called. According to the documentation error message (event.response) can be only returned when using iAds.

What is the error?  Can you print the contents of the event table? 

for k, v in pairs(event)

    print(k, “:”,  v)

end

Rob

I don’t know why, but today it’s not showing any errors and working.

When you depend on a 3rd party service, you are subject to the internet being down anywhere between you and the service or the service being temporarily unavailable.   These transient issues are normal for the Internet and your app needs to be hardened so that it doesn’t cause you problems.

Rob

What is the error and what is the line of code where the error is happening?

Rob

Error is happening when I’m trying to show an ad. The problem is I don’t know what an error is. Just the event is called. According to the documentation error message (event.response) can be only returned when using iAds.

What is the error?  Can you print the contents of the event table? 

for k, v in pairs(event)

    print(k, “:”,  v)

end

Rob

I don’t know why, but today it’s not showing any errors and working.

When you depend on a 3rd party service, you are subject to the internet being down anywhere between you and the service or the service being temporarily unavailable.   These transient issues are normal for the Internet and your app needs to be hardened so that it doesn’t cause you problems.

Rob