Skip to main content

Documentation Index

Fetch the complete documentation index at: https://guide.daro.so/llms.txt

Use this file to discover all available pages before exploring further.

Interstitial Ad Format

  • Full-screen ads that cover the app interface.
  • Use them at natural breaks, such as between game rounds, during screen transitions, or after major user actions.

Integrating Ads

1

Create Ad Instance

private DaroInterstitialAd ad;

ad = new DaroInterstitialAd("your-interstitial-ad-unit-id");
2

Register Event Handlers

ad.OnAdLoaded += info => Debug.Log("interstitial loaded");
ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
ad.OnAdShown += info => Debug.Log("shown");
ad.OnAdFailedToShow += error => Debug.LogWarning(error.Message);
ad.OnAdClicked += info => Debug.Log("clicked");
ad.OnAdImpression += info => Debug.Log("impression");
ad.OnAdDismissed += info => Debug.Log("dismissed");
3

Load Ad

ad.Load();
4

Show Ad

if (ad != null && ad.IsReady())
{
    ad.Show();
}
5

Dispose Ad

ad?.Dispose();
ad = null;

Example

using Daro;
using UnityEngine;

public sealed class InterstitialHost : MonoBehaviour
{
    [SerializeField] private string adUnitId = "your-interstitial-ad-unit-id";
    private DaroInterstitialAd ad;

    private void OnEnable()
    {
        ad = new DaroInterstitialAd(adUnitId);
        ad.OnAdLoaded += info => Debug.Log($"loaded latency={info.Latency}ms");
        ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
        ad.OnAdDismissed += info => ad?.Load();
        ad.Load();
    }

    public void Show()
    {
        if (ad != null && ad.IsReady())
        {
            ad.Show();
        }
    }

    private void OnDisable()
    {
        ad?.Dispose();
        ad = null;
    }
}