appodeal.load()

Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, Appodeal, load
See also appodeal.init()
appodeal.show()
appodeal.isLoaded()

Overview

Pre-loads an Appodeal banner, interstitial, or rewarded video ad for instant display upon a future call to appodeal.show().

By default, Appodeal automatically caches ads in the background, so there is normally no need to load ads in advance. To use this function, you must turn off automatic caching as described in the documentation for appodeal.init().

Syntax

appodeal.load( adUnitType )
adUnitType (required)

String. Valid values include "banner", "interstitial", and "rewardedVideo".

Example

local appodeal = require( "plugin.appodeal" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Pre-load a static interstitial ad
        appodeal.load( "interstitial" )
    end
end

-- Initialize the Appodeal plugin
appodeal.init( adListener, { appKey="YOUR_APP_KEY", autoCacheAds=false } )