appnext.setShowClose()

Type Function
Return value none
Revision 2017.3060
Keywords ads, advertising, Appnext, setShowClose
See also appnext.getShowClose()
appnext.*

Overview

Effects full-screen and rewarded video ads only. Displays or hides the "close" button.

Syntax

appnext.setShowClose( adKey, showClose )
adKey (required)

String. The ad key returned for a previously created ad.

showClose (required)

Boolean. Indicates whether the "close" button will be shown or hidden.

Example

local appnext = require( "plugin.appnext" )

local function adListener( event )
    print( "Received " .. event.event .. " for " .. event.adKey .. " with message: " .. event.message )
end

-- Initialize the Appnext plugin
appnext.init( adListener )

-- Create your ads
local fullscreenPlacementID

local platform = system.getInfo( "platformName" )
if ( platform == "iPhone OS" ) then
    fullscreenPlacementID = "YOUR_IOS_FULLSCREEN_PLACEMENT_ID"
elseif ( platform == "Android" ) then
    fullscreenPlacementID = "YOUR_ANDROID_FULLSCREEN_PLACEMENT_ID"
end

local fullscreenAdKey = appnext.createAd( "fullscreen", fullscreenPlacementID )

appnext.setShowClose( fullscreenAdKey, true )