Type Function Return value none Revision 2017.3060 Keywords ads, advertising, AdMob, init See also admob.show() admob.load() admob.*
admob.init() initializes the AdMob plugin. This call is required and must be executed before making other AdMob calls such as admob.load().
admob.init( listener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing AdMob initialization values — see the next section for details.
The params table includes parameters for AdMob initialization.
Boolean. Set this value to true to enable test ads. Default is false.
You should always use test ads during development testMode = true)
local admob = require( "plugin.admob" )
-- AdMob listener function
local function adListener( event )
if ( event.phase == "init" ) then -- Successful initialization
print( event.provider )
end
end
-- Initialize the AdMob plugin
admob.init( adListener, { appId="YOUR_ADMOB_APP_ID" } )