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

Overview begins showing ads at the specified screen location.

Syntax 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.


local ads = require( "ads" )

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

ads.init( "admob", "myAppId", adListener ) "banner", { x=0, y=0, appId="otherAppId" } )