Type Function Return value none Revision 2017.3060 Keywords ads, advertising, Appodeal, init See also appodeal.show() appodeal.*
appodeal.init()
initializes the Appodeal plugin.
Once initialized, you can show an ad using appodeal.show().
appodeal.init( adListener, params )
Listener. Listener function that will receive adsRequest events.
Table. Table containing Appodeal initialization values — see the next section for details.
The params
table includes initialization properties for the Appodeal plugin.
String. Your Appodeal app key. You can find this ID in the Appodeal developer portal, located under your app's name as "Application Key."
Boolean. Test mode enables verbose logging to help with debugging and it also serves test ads from networks that support them. To enable test mode, set this value to true
. Default is false
.
Boolean. By default, Appodeal automatically caches ads in the background. Set this value to false
to turn it off. Default is true
. If you turn automatic caching off, you must use appodeal.load() to manually load ads.
Table. Set custom rules to be used with placements. Placements are an advanced feature used together with "Segments" as defined in the Appodeal dashboard. This is a table with
Array. Limits the type of ads you want Appodeal to serve. By default, banner, static interstitial, video, and rewarded video ads will be served. You can limit the type of ads to load by specifying which types to support inside this table array. Valid values include "banner"
, "interstitial"
, "video"
and "rewardedVideo"
.
local appodeal = require( "plugin.appodeal" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) end end -- Initialize the Appodeal plugin appodeal.init( adListener, { appKey="YOUR_APP_KEY" } )