appnext.setButtonColor()

Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, Appnext, setButtonColor
See also appnext.getButtonColor()
appnext.*

Overview

Sets the install button’s color.

Syntax

appnext.setButtonColor( adKey, buttonColor )
adKey (required)

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

buttonColor (required)

String. The install button’s color as a 6-character hexadecimal color starting with #.

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 interstitialPlacementID

local platform = system.getInfo( "platformName" )
if ( platform == "iPhone OS" ) then
    interstitialPlacementID = "YOUR_IOS_INTERSTITIAL_PLACEMENT_ID"
elseif ( platform == "Android" ) then
    interstitialPlacementID = "YOUR_ANDROID_INTERSTITIAL_PLACEMENT_ID"
end

local interstitialAdKey = appnext.createAd( "interstitial", interstitialPlacementID )

appnext.setButtonColor( interstitialAdKey, "#6AB344" )