Type Function Return value none Revision 2017.3060 Keywords ads, advertising, Appodeal, show See also appodeal.hide() appodeal.*
Shows an Appodeal ad. By default, Appodeal automatically caches ads in the background, so there is normally no need to load ads in advance of calling this method. However, automatic caching may be disabled when calling appodeal.init().
appodeal.show( adUnitType [, params] )
String. The type of ad you wish to display. Valid values include "banner"
, "interstitial"
, "video"
, and "rewardedVideo"
.
Table. Table containing positioning parameters for banner ads — see the next section for details.
The params
table can include properties for positioning a banner ad. This does not apply to interstitial or video ads.
String. Vertical alignment of the banner. Valid options are "top"
and "bottom"
. Default is "bottom
.
String. The placement you want the ad to be associated with. Placements are an advanced feature used together with "Segments" as defined in the Appodeal dashboard.
local appodeal = require( "plugin.appodeal" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Show a banner ad appodeal.show( "banner", { yAlign="top" } ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) end end -- Initialize the Appodeal plugin appodeal.init( adListener, { appKey="YOUR_APP_KEY" } )