revmob.show()

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

Overview

Shows a RevMob ad which was previously loaded via revmob.load().

Syntax

revmob.show( placementId [, params] )
placementId (required)

String. The placement ID of the ad you want to show.

params (optional)

Table. Optional table containing placement customization values — see the next section for details.

Parameter Reference

The params table includes parameters to customize the ad placement.

yAlign (required)

String. The vertical alignment of a RevMob banner ad. Valid options are "top", "center", or "bottom".

Example

local revmob = require( "plugin.revmob" )

local placementID = "PLACEMENT_ID"

local function adListener( event )

    if ( event.phase == "sessionStarted" ) then  -- Successful initialization
        -- Load a RevMob ad
        revmob.load( "banner", placementID )

    elseif ( event.phase == "loaded" ) then  -- The ad was successfully loaded
        -- Show the ad
        revmob.show( placementID, { yAlign="top" } )
    end
end

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