Type Function Return value none Revision Release 2022.3683 Keywords ads, advertising, Chartboost, show See also chartboost.init() chartboost.load() chartboost.isLoaded()
Shows a Chartboost static interstitial, video interstitial, rewarded video, or the "more apps" screen.
An ad should be
Before calling this function, you must call chartboost.init() and and ensure that the "init"
event phase occurs.
chartboost.show( adType [, namedLocation] )
String. One of the following values:
"interstitial"
"rewardedVideo"
"moreApps"
(Deprecated. Will be removed from the Chartboost SDK in July 2017)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
The following list outlines the
Location | Scene/Description |
---|---|
"Default" |
Legacy default location |
"Startup" |
Initial startup of the game |
"Home Screen" |
Home screen which the player first sees |
"Main Menu" |
Menu which provides game options |
"Game Screen" |
Game screen where the magic happens |
"Achievements" |
List of achievements in the game |
"Quests" |
Quests, missions, or goals screen |
"Pause" |
Pause screen |
"Level Start" |
Start of the level |
"Level Complete" |
Completion of the level |
"Turn Complete" |
When the player finishes a turn in the game |
"IAP Store" |
Store where the player uses real money to buy virtual goods |
"Item Store" |
Store where the player uses virtual money to buy virtual goods |
"Game Over" |
The "game over" screen |
"Leaderboard" |
List of statistical leaders in the game |
"Settings" |
Screen where player can change game settings |
"Quit" |
Screen displayed immediately before the player exits/quits |
local chartboost = require( "plugin.chartboost" ) -- Chartboost listener function local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization chartboost.load( "interstitial" ) elseif ( event.phase == "loaded" ) then if ( event.type == "interstitial" ) then chartboost.show( "interstitial" ) end end end -- Initialize the Chartboost plugin chartboost.init( adListener, { appId="YOUR_CHARTBOOST_APP_ID", appSig="YOUR_CHARTBOOST_APP_SIGNATURE" } )