Type Function Return value none Revision Release 2022.3683 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().
For Android users, some adapters may work more effectively with android.permission.WRITE_EXTERNAL_STORAGE
permission, make sure to include it in your project manually.
Use disableWriteExternalPermissionCheck
init parameter with false
value if you want to use that ability for your project.
Now you can disable autocache for specific ad type! Check out new disableAutoCacheForAdTypes
init parameter below to know more.
autoCacheAds
parameter is deprecated from now on, so make sure that everything is configured correctly.
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. Set to true
to flag your app as COPPA compliant. Default is false
.
Table. Manual Filters allows to groups users by any available characteristics. E.g. you know the sources that directed users to you and you want to track the statistics for such users — group them into a segment . You can read more in Appodeal Knowledge Base. This is a table with
Array. Limits the type of ads you want Appodeal to serve. By default, banner, static interstitial, 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"
, and "rewardedVideo"
.
Boolean. You must set this value to true
if you don't want to use optional android.permission.WRITE_EXTERNAL_STORAGE
permission (for reasons stated above in the description). Default is false
.
Array. For advanced use only. Prevent the Appodeal SDK from looking for specified ad network SDKs during initialization. Valid values include "adcolony"
, "admob"
, "amazon_ads"
, "applovin"
, "appnext"
, "avocarrot"
, "chartboost"
, "facebook"
, "flurry"
, "inmobi"
, "inner-active"
, "ironsource"
, "mailru"
, "mmedia"
, "mopub"
, "ogury"
, "openx"
, "pubnative"
, "smaato"
, "startapp"
, "tapjoy"
, "unity_ads"
, "vungle"
, and "yandex"
. If you simply wish to prevent advertising from certain ad networks, you should not use this option — instead, you can select preferred ad networks for your app in the Appodeal dashboard.
Array. For advanced use only. Disable autocache for specified ad types during Appodeal SDK initialization. Valid values include "banner"
, "interstitial"
, "rewardedVideo"
.
Boolean. If set to false
, Appodeal will enable GDPR data collection restrictions, set to true
for opposite. Default is false
.
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" } )