chartboost.load()

Type Function
Return value none
Revision 2017.3060
Keywords ads, advertising, Chartboost, load
See also chartboost.init()
chartboost.show()
chartboost.isLoaded()

Overview

Pre-loads a Chartboost static interstitial, video interstitial, rewarded video, or the "more apps" screen for instant loading upon a future call to chartboost.show().

Gotchas

Syntax

chartboost.load( adType [, namedLocation] )
adType (required)

String. One of the following values:

  • "interstitial"
  • "rewardedVideo"
  • "moreApps"
namedLocation (optional)

String. The advertisement location. If omitted, the legacy "Default" location will be used. Although you can specify any string, Chartboost recommends using one of their pre-defined locations to help keep eCPM levels as high as possible. See here for a list of valid pre-defined options.

Example

local chartboost = require( "plugin.chartboost" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Pre-load the "more apps" screen
        chartboost.load( "moreApps" )
    end
end

-- Initialize the Chartboost plugin
chartboost.init( adListener, { appId="YOUR_CHARTBOOST_APP_ID", appSig="YOUR_CHARTBOOST_APP_SIGNATURE" } )