appnext.getShowClose()

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

Overview

Relevant for full-screen and rewarded video ads only. Gets the setting for whether the "close" button is shown or hidden.

Syntax

appnext.getShowClose( adKey )
adKey (required)

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

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 )

if ( appnext.getShowClose( fullscreenAdKey ) ) then
    print( "Close button is shown" )
else
    print( "Close button is hidden" )
end