adcolony.load()

Type Function
Return value none
Revision 2018.3353
Keywords ads, advertising, AdColony, load
See also adcolony.init()
adcolony.isLoaded()

Overview

Loads an AdColony video interstitial or rewarded video.

Note

Before calling this function, you must call adcolony.init() and ensure that the "init" event phase occurs.

Syntax

adcolony.load( zoneName [, params ] )
zoneName (required)

String. The user-defined AdColony zone name to be loaded. Zone names should be specified in the call to adcolony.init().

params (optional)

Table. Table containing params for rewarded videos — see the next section for details.

Parameter Reference

The params table includes parameters for rewarded videos.

prePopup (optional)

Boolean. If true, displays a confirmation popup prior to displaying a rewarded video. Default is false.

postPopup (optional)

Boolean. If true, displays a popup with reward info after displaying a rewarded video. Default is false.

Example

local adcolony = require( "plugin.adcolony" )

-- AdColony listener function
local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Load an interstitial ad
        adcolony.load( "interstitial" )
    end
end

-- Initialize the AdColony plugin
adcolony.init( adListener,
    {
        appId = "YOUR_ADCOLONY_APP_ID",
        adZones = {
            interstitial = "YOUR_ADCOLONY_ZONE_ID_1",
            rewardedVideo = "YOUR_ADCOLONY_ZONE_ID_2"
        }
    })