For the complete documentation index, see llms.txt. This page is also available as Markdown.
AdBlock
You are reading the documentation for Bridge SDK v2. If you need the obsolete v1 documentation, see Documentation (v1).
Detect whether the player has an ad blocker enabled. This is informational only: it does not suppress ads, but it lets you adapt UI, skip empty banner slots, or show a polite prompt.
Call this when you need to adapt ad-related UI for players with blocked ads.
bridge.advertisement.checkAdBlock().then(result=>{console.log(result) // true or false}).catch(error=>{console.log(error)})
privatevoidStart(){Bridge.advertisement.CheckAdBlock(OnCheckAdBlockCompleted);}privatevoidOnCheckAdBlockCompleted(boolresult){Debug.Log(result);// true or false}
In the event sheet:
On a trigger (e.g. Button → On clicked), add the PlaygamaBridge Check Ad Block action.
Add the On Check AdBlock Completed condition. Inside it, use the Is AdBlock Detected condition to branch your UI.
playgama_bridge_advertisement_check_adblock()
// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_advertisement_check_adblock_callback" {
if async_load[? "success"] {
var is_adblock_detected = async_load[? "data"]
}
}
local bridge = require("bridge.bridge")
function init(self)
bridge.advertisement.check_ad_block(function (_, data)
print("Is adblock detected: ", data)
end,
function ()
-- error
end)
end