Banner

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

Playgama Bridge Config

Is Banner Supported

Check if the platform supports displaying banner ads. Use this to determine if you can include banner advertisements in your game.

// Possible values: true, false
Bridge.advertisement.isBannerSupported

Ensure that in-game banners are not displayed during gameplay on CrazyGames. Please refer to Advertisement - CrazyGames Documentation.

Show Banner

Display a banner ad within your game to generate revenue through advertising.

private void Start()
{
    var position = BannerPosition.Bottom; // optional, 'Top' | 'Bottom', default = Bottom
    var placement = "test_placement"; // optional
    Bridge.advertisement.ShowBanner(position, placement);
}

Hide Banner

Hide the currently displayed banner ad when it is no longer needed.

Bridge.advertisement.HideBanner()

Monitor the state of the banner ad (loading, shown, hidden, failed) to manage its display and troubleshoot issues.

Bridge.advertisement.bannerState

Possible values: Loading, Shown, Hidden, Failed.

// To track banner state changes, subscribe to the event
private void Start()
{
    Bridge.advertisement.bannerStateChanged += OnBannerStateChanged;
}

private void OnBannerStateChanged(BannerState state)
{
    Debug.Log(state);
}

Last updated