startapp.showSplash()

类型 函数
返回值
修订版 版本 2024.3703
关键字 广告、广告推广、StartApp、隐藏
另请参阅 startapp.show()
startapp.*

概述

在应用程序启动后立即展示StartApp 启动页广告。启动页广告首先显示一个预定义的全屏启动页(你可以对其进行自定义,如下文所述),然后展示一个全屏广告。

需注意的事项

要使用启动页广告,请仅在 startapp.init() 之后立即调用一次 startapp.showSplash()

语法

startapp.showSplash( [ params ] )
params (可选)

. 包含启动页的其他配置 — 有关详细信息,请查看下一部分。

参数参考

params 表中包含启动页的配置。

theme (可选)

字符串. 通过六个选项之一为启动页指定设计主题:"deep_blue"(默认值)、"sky""ashen_sky""blaze""gloomy""ocean"

appName (可选)

字符串. 设置要在启动页中使用的应用程序名称。

orientation (可选)

字符串. 设置要在启动页中使用的方向。有效值为
"portrait"(默认值)、"landscape""auto"(在进入应用程序时使用设备的方向)。

示例

local startapp = require( "plugin.startapp" )

local function adListener( event )
    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.provider )
        -- Load an StartApp ad
        startapp.load( "interstitial" )
    end
end

-- Initialize the StartApp plugin
startapp.init( adListener, { appId = "Your App ID" } )

-- Show the StartApp splash
startapp.showSplash( { appName = "Your App Name" } )