appnext.setButtonText()

类型 函数
返回值
修订 发行版 2024.3703
关键字 广告、Appnext、setButtonText
另请参见 appnext.getButtonText()
appnext.*

概览

设置安装按钮的文本(默认值为 "安装".

语法

appnext.setButtonText( adKey, buttonText )
adKey (必需)

字符串. 之前创建的广告返回的广告密钥。

buttonText (必需)

字符串. 广告的安装按钮文本。

示例

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.setButtonText( interstitialAdKey, "Install App" )