admob.show()

Type Function
Return value none
Revision Current Public Release (2014.2511)
Keywords ads, advertising, admob
See also ads.hide()
ads.init()
admob.*

Overview

ads.show() begins showing ads at the specified screen location.

Syntax

ads.show( adUnitType [, params] )
adUnitType (required)

String. The type of ad to show. AdMob supports either "banner" or "interstitial".

params (optional)

Table. A table that specifies properties for the ad request — see the next section for details.

Parameter Reference

The params table can include properties for the ad request.

x (optional)

Number. The left position of the ad. Defaults to 0.

y (optional)

Number. The top position of the ad. Defaults to 0.

interval (optional)

Number. The ad refresh time, in seconds.

appId (optional)

String. The app ID. If this is not specified, the value provided to ads.init() is used instead.

Example

local ads = require( "ads" )

local function adListener( event )
    if ( event.isError ) then
        --Failed to receive an ad
    end
end

ads.init( "admob", "myAppId", adListener )

ads.show( "banner", { x=0, y=0, appId="otherAppId" } )