Type Function Return value none Revision Release 2024.3703 Keywords ads, advertising, Chartboost, init See also chartboost.load() chartboost.show()
chartboost.init()
initializes the Chartboost plugin. This call is required and must be executed before making other Chartboost calls such as chartboost.load() or chartboost.show().
chartboost.init( listener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing Chartboost initialization values — see the next section for details.
The params
table includes parameters for Chartboost initialization.
String. The App ID for your app, gathered from the Chartboost dashboard.
String. The App signature for your app, gathered from the Chartboost dashboard.
Boolean. If set to true
, Chartboost will automatically attempt to load another ad when one has been consumed via a chartboost.show() call. When false
, it’s your responsibility to manage loading behavior. Default is false
.
String. Use this to set a custom identifier that can be used to group information in the Chartboost dashboard.
Boolean. If set to false
, Chartboost will enable GDPR data collection restrictions, set to true
for opposite. Default is false
.
For developers migrating from the Corona Ads incarnation of the Chartboost plugin, the following parameters have been removed from this new plugin:
apiKey
; replaced by appId
and appSig
testMode
; this is now set per-app in the Chartboost dashboardappOrientation
; this is now set per-app in the Chartboost dashboardlocal chartboost = require( "plugin.chartboost" ) -- Chartboost listener function local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.provider ) end end -- Initialize the Chartboost plugin chartboost.init( adListener, { appId="YOUR_CHARTBOOST_APP_ID", appSig="YOUR_CHARTBOOST_APP_SIGNATURE" } )