Admob Ads not showing (SOLVED)

Hi,

I’m using the following admob extention:
https://github.com/Lerg/extension-admob/archive/legacy.zip

I have the following code:

local m_app = require('modules/app')

function init(self)
    local function listener(event)
        if event.phase == 'init' then
            admob.load
            {
                type = 'interstitial',
			    id = 'ca-app-pub-1234567890/1234567890',
			    immersive = true,
		    }
	    end
    end

    admob.init
    {
	    test = true,
	    listener = listener
    }
end

function on_message(self, message_id, message, sender)
    if message_id == m_app.MESSAGE_ADMOB_SHOW then
	    admob.show('interstitial')
        print('show')
    end
end

I have also set the android_app_id in the game.project and and when I bundle for Android I only get the print when I try to show an ad.

Use pprint(event) as the first line in the listener() function.
Maybe ads fails to load.

Ah. and try with an empty keywords table for the load() param. There was a bug that keywords param was treated as required, fixed in the later version, but not sure if it’s the case here.

Yes!
I’ve added the empty keywords table and now my ads are showing.

Thank you.

1 Like