Type Function Return value none Revision Release 2024.3703 Keywords ads, advertising, AppLovin, load See also applovin.show() applovin.isLoaded() applovin.*
Preloads a AppLovin ad. You can also call applovin.isLoaded() to verify that the ad has been loaded and applovin.show() to show it.
applovin.load( adType )
String. One of the following values:
"banner"
"interstitial"
"rewardedVideo"
When you use "interstitial"
, both static interstitial ads and video interstitial ads may be loaded. You configure the type of ads to be used in the AppLovin developer portal.
You must enable "Rewarded Video" in the AppLovin developer portal to receive rewarded videos in your app.
Rewarded video offers can be limited to a certain amount in a given day, defined under "frequency capping" in the AppLovin developer portal. If you are using frequency capping, we recommend that you check for an event.phase value of "validationExceededQuota"
to determine if the limit has been reached. When this occurs, you may consider loading/showing an interstitial ad instead.
Table. Table containing AppLovin ad loading options.
The params
table includes parameters for the AppLovin ad loading.
local applovin = require( "plugin.applovin" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) -- Load an AppLovin ad applovin.load( "interstitial" ) elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) end end -- Initialize the AppLovin plugin applovin.init( adListener, { sdkKey="YOUR_SDK_KEY" } )