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.
- 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
Create Ad Instance
private DaroInterstitialAd ad;
ad = new DaroInterstitialAd("your-interstitial-ad-unit-id");
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");
Show Ad
if (ad != null && ad.IsReady())
{
ad.Show();
}
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;
}
}