chartboost.load()

Type Function
Return value none
Revision Release 2024.3703
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" (Deprecated. Will be removed from the Chartboost SDK in July 2017)
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( "interstitial" )
    end
end

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