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.

  • Ads fixed to the top or bottom of the screen.
  • Places a native banner view over the Unity screen.

Integrating Ads

1

Create Ad Instance

private DaroBannerAd ad;

ad = new DaroBannerAd(
    "your-banner-ad-unit-id",
    DaroBannerSize.Standard,
    DaroBannerPosition.BottomCenter
);
2

Register Event Handlers

ad.OnAdLoaded += info => ad.Show();
ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
ad.OnAdImpression += info => Debug.Log("impression");
ad.OnAdClicked += info => Debug.Log("clicked");
ad.OnAdHidden += info => Debug.Log("hidden");
3

Load Ad

ad.Load();
4

Hide or Dispose Ad

ad.Hide();    // Can be shown again.
ad.Dispose(); // Releases the ad.

Example

using Daro;
using UnityEngine;

public sealed class BannerHost : MonoBehaviour
{
    [SerializeField] private string adUnitId = "your-banner-ad-unit-id";
    private DaroBannerAd ad;

    private void OnEnable()
    {
        ad = new DaroBannerAd(
            adUnitId,
            DaroBannerSize.Standard,
            DaroBannerPosition.BottomCenter
        );

        ad.OnAdLoaded += info => ad.Show();
        ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
        ad.Load();
    }

    public void Hide()
    {
        ad?.Hide();
    }

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