类型 函数 返回值 无 修订版 2024.3703 版本 关键字 广告、广告宣传、Pollfish、init 另请参见 pollfish.show() pollfish.*
pollfish.init()
初始化 Pollfish 插件。调用后,你必须等待 event.phase 为 "init"
才能使用 pollfish.load() 加载调查。
此调用需要 API 密钥,该密钥可通过 Pollfish 门户网站 获得。
pollfish.init( adListener, params )
监听器. 将接收 adsRequest 事件的监听器函数。
表. 包含 Pollfish 初始化值的表——有关详情,请参阅下一节。
params
表包括 Pollfish 初始化的以下参数。
字符串. 你从 Pollfish 门户网站 获取的 API 密钥。
布尔值. 将此值设置为 true
以激活开发者模式。默认为 false
。
true
用于帮助开发者测试 Pollfish 调查在应用程序中的行为(不会展示已付费调查)。
false
激活发布模式。对已发布到应用商店的应用程序使用此模式(开始接收付费调查)。
字符串. 用于识别用户的唯一 ID。此 ID 也会通过
local pollfish = require( "plugin.pollfish" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization pollfish.load() end end -- Initialize the Pollfish plugin pollfish.init( adListener, { apiKey="YOUR_API_KEY" } )