类型 函数 返回值 布尔值 修订版本 版本 2024.3703 关键词 广告, Supersonic, isLoaded 另请参阅 supersonic.show() supersonic.load() supersonic.*
检查广告是否已加载。如果广告已加载/准备就绪,则返回 true
,否则返回 false
。
supersonic.isLoaded( adUnitType )
字符串. 您希望检查是否已加载的广告类型。支持的值为 "offerWall"
(推荐墙), "interstitial"
(插屏广告), 或 "rewardedVideo"
(激励视频广告)。
local supersonic = require( "plugin.supersonic" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization -- Load an offer wall ad supersonic.load( "offerWall", "user2353" ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) end end -- Initialize the Supersonic plugin supersonic.init( adListener, { appKey="YOUR_APP_KEY" } ) -- Sometime later, check if the ad is loaded local isAdLoaded = supersonic.isLoaded( "offerWall" ) print( isAdLoaded )