For the complete documentation index, see llms.txt. This page is also available as Markdown.

Displaying Ads

Displaying an Interstitial Ad

Interstitial ads are shown manually when needed, usually during natural breaks in gameplay such as between levels or after an action is completed.

Use TryShowInterstitial to attempt to show an interstitial ad. This method returns true if the ad was shown successfully, and false if an interstitial ad was not available.

public static bool TryShowInterstitial(
    string placement,
    Action onClosed = null,
    Dictionary<string, object> additionalData = null)
  • Placement: A string identifier used to track where the ad was shown from.

  • On Closed: Optional callback invoked when the ad is closed.

  • Additional Data: Optional metadata for analytics or reporting.

Example

private void ShowInterstitialAd()
{
    const string placement = "level_complete";

    if (LionAds.TryShowInterstitial(placement, AdClosed))
    {
        Debug.Log("Interstitial ad shown.");
    }
    else
    {
        Debug.Log("Interstitial ad not available.");
    }
}

private void AdClosed()
{
    Debug.Log("Interstitial ad closed.");
}

Displaying a Rewarded Ad

Rewarded ads are shown manually when you want to offer a user a reward in exchange for watching an ad.

Use TryShowRewarded to attempt to show a rewarded ad. This method returns true if the ad was shown successfully, and false if a rewarded ad was not available.

  • Placement: A string identifier used to track where the ad was shown from.

  • On Rewarded: Called when the user earns the reward.

  • On Closed: Optional callback invoked when the ad is closed.

  • Reward: Optional reward data associated with the ad for analytics or reporting

  • Additional Data: Optional metadata for analytics or reporting.

Example

Displaying Banner Ads

Banner ads are loaded automatically during SDK initialization. You can customize the banner experience using the settings below:

  • Position: Where the banner will be displayed on screen.

  • Color: The background color behind the banner.

  • Disable Show Immediate: When enabled, banners are loaded but not shown automatically. Call ShowBanner() manually to display them.

    When disabled, banners are shown automatically once loaded.

circle-exclamation

Show Banner

Hide Banner

Last updated

Was this helpful?