adbuddiz.showAd()

Type Function
Return value none
Revision 2017.3060
Keywords ads, advertising, AdBuddiz, showAd
See also adbuddiz.isReadyToShowAd()
adbuddiz.cacheAds()
adbuddiz.*

Overview

Presents an ad on screen if one is available. You can use adbuddiz.cacheAds() to cache ads and adbuddiz.isReadyToShowAd() to determine if an ad is available.

Syntax

adbuddiz.showAd( [placement] )
placement (optional)

String. The placement name.

Example

local function listener( event ) 
    if event.value == "didCacheAd" then
        print( "didCacheAd" )  -- An ad was cached
    end
    if event.value == "didShowAd" then
        print( "didShowAd" )  -- An ad was displayed
    end
    if event.value == "didClick" then
        print( "didClick" )  -- The ad was clicked
    end
    if event.value == "didHideAd" then
        print( "didHideAd" )  -- The ad was hidden
    end
    if event.value == "didFailToShowAd" then
        print( "didFailToShowAd - " .. event.detail )  -- No ad displayed; explanation available in 'event.detail'
    end
end
Runtime:addEventListener( "AdBuddizEvent", listener )

adbuddiz.showAd()