Type Function Return value none Revision Release 2022.3683 Keywords ads, advertising, SuperAwesome, load See also superawesome.show() superawesome.isLoaded() superawesome.*
Preloads a SuperAwesome ad. You can also call superawesome.isLoaded() to verify that the ad has been loaded and superawesome.show() to show it.
superawesome.load( adUnitType, params )
String. The type of ad according to the SuperAwesome placement ID. Supported values are "banner"
, "interstitial"
, or "video"
.
Table. Table containing customization parameters for the specified ad type — see the next section for details.
The params
table containing customization parameters for the specified ad type.
String. The placement ID for the ad to be loaded, retrieved from the SuperAwesome dashboard.
local superawesome = require( "plugin.superawesome" ) -- Pre-declare a placement ID local myPlacementID = "YOUR_PLACEMENT_ID" local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load a banner ad superawesome.load( "banner", { placementId=myPlacementID } ) elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) print( event.placementId ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.placementId ) print( event.isError ) end end -- Initialize the SuperAwesome plugin superawesome.init( adListener, { testMode=true } )