Interstitial

There are some advertisement settings in the playgama-bridge-config.json file

Playgama Bridge Config

Interstitial ads typically appear during transitions in the game, such as level loading or after game over.

Minimum Interval Between Displays

Set the minimum time interval between interstitial ad displays to comply with platform requirements and improve user experience.

-- Get delay, default value = 60 seconds
bridge.advertisement.minimum_delay_between_interstitial()

-- Set new delay
bridge.advertisement.set_minimum_delay_between_interstitial(30)

There should be time intervals between interstitial ad displays. For convenience, this SDK includes a built-in timer mechanism between ad displays. You just need to specify the required interval, and you can call the ad display method as often as you like.

Interstitial State

Track the state of the interstitial ad to manage ad display and user experience.

bridge.advertisement.interstitial_state()

Possible values: loading, opened, closed, failed.

local bridge = require("bridge.bridge")

function init(self)
	bridge.advertisement.on("interstitial_state_changed", function (_, state)
		print("Interstitial state changed: ", state)
	end)
end

React to changes in ad state. For example, mute the game sound when opened and unmute when closed and failed.

Show Interstitial

Display an interstitial ad at appropriate moments, such as during level transitions or game over screens.

local placement = "test_placement" -- optional
bridge.advertisement.show_interstitial(placement)

Last updated