Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Implement interstitial ads in your Unity project.
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");
Load Ad
ad.Load();
Show Ad
if (ad != null && ad.IsReady()) { ad.Show(); }
Dispose Ad
ad?.Dispose(); ad = null;
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; } }