appnext.setProgressType()

类型 函数
返回值
修订 版本 2024.3703
关键字 广告、Appnext、getProgressType
另请参阅 appnext.setProgressType()
appnext.*

概览

仅影响全屏展示和奖品广告。设置或隐藏进度类型(默认为 "clock").

语法

appnext.setProgressType( adKey, progressType )
adKey (必需)

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

progressType (必需)

字符串.要为广告设置的进度类型。可能的值为 "clock""bar""none""default"

示例

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.setProgressType( fullscreenAdKey, "bar" )