revmob.init()

Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, RevMob, init
See also revmob.load()
revmob.show()
revmob.*

Overview

revmob.init() initializes the RevMob plugin.

Once initialized, you can load an ad using revmob.load() and subsequently show it via revmob.show().

Note

This call requires your RevMob app ID. You can get this from the RevMob Developer Portal.

Syntax

revmob.init( adListener, params )
adListener (required)

Listener. Listener function that will receive adsRequest events.

params (required)

Table. Table containing RevMob initialization values — see the next section for details.

Parameter Reference

The params table includes parameters for RevMob initialization.

appId (required)

String. Your app ID from RevMob.

Example

local revmob = require( "plugin.revmob" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.isError )
    end
end

-- Initialize RevMob
revmob.init( adListener, { appId="YOUR_APP_ID" } )