Banner

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

Show Banner

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

private void Start()
{
    var options = new Dictionary<string, object>();

    switch (Bridge.platform.id)
    {
        case "vk":
            options.Add("position", "bottom");
            options.Add("layoutType", "resize");
            options.Add("canClose", false);
            break;
    }

    Bridge.advertisement.ShowBanner(options);
}

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