类型 函数 返回值 无 修订 版本 2024.3703 关键词 广告, RevMob, startSession 另请参阅 revmob.init() revmob.* 
启动 RevMob 会话。建议您在 "applicationResume" 系统 事件中调用此函数(请参阅下面的示例)。
当您成功调用 revmob.init() 时,RevMob 会话会自动启动。
revmob.startSession()
local revmob = require( "plugin.revmob" )
local function adListener( event )
    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.isError )
    end
end
-- Initialize RevMob
revmob.init( adListener, { appId="YOUR_APP_ID" } )
-- System event listener function
local function onSystemEvent( event )
    if ( event.type == "applicationResume" ) then
        -- Start a new RevMob session
        revmob.startSession()
    end
end
-- Add the system event listener
Runtime:addEventListener( "system", onSystemEvent )