类型 函数 返回值 无 版本 版本 2024.3703 关键词 广告,广告宣传,Appodeal,canShow 另请参阅 appodeal.show() appodeal.*
用于检查是否可为指定广告类型展示广告。
appodeal.canShow( adUnitType, placement )
字符串. 您希望检查的广告类型。有效的值包括 "banner"
、"interstitial"
和 "rewardedVideo"
。
字符串. 您希望与广告相关联的位置。位置可以让您按广告展示之处来分离广告展示情况。您可以在 Appodeal 知识库 中阅读更多相关内容。
local appodeal = require( "plugin.appodeal" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.isError ) print( event.response ) end end -- Initialize the Appodeal plugin appodeal.init( adListener, { appKey="YOUR_APP_KEY" } ) -- Sometime later, check if an ad can be shown if ( appodeal.canShow( "interstitial" ) ) then appodeal.show( "interstitial" ) end