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.

Native Ad Format

  • Ads rendered inside your app UI.
  • Attach DaroNativeAdView to a Unity UI prefab and wire slots, or read DaroNativeAd.Info directly into custom UI.

Integrating Ads

1

Prepare Native Ad View

Add DaroNativeAdView to the Unity UI prefab root. Wire TitleText, BodyText, IconImage, CtaButton, and MediaContainer.
2

Create Ad Instance

private DaroNativeAd ad;
[SerializeField] private DaroNativeAdView adView;

ad = new DaroNativeAd("your-native-ad-unit-id");
3

Register Event Handlers

ad.OnAdLoaded += info => adView.Bind(ad);
ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
ad.OnAdImpression += info => Debug.Log("impression");
ad.OnAdClicked += info => Debug.Log("clicked");
4

Load Ad

adView.LoadFor(ad);
5

Dispose Ad

adView.Unbind();
ad?.Dispose();
ad = null;

Example

using Daro;
using UnityEngine;

public sealed class NativeAdHost : MonoBehaviour
{
    [SerializeField] private string adUnitId = "your-native-ad-unit-id";
    [SerializeField] private DaroNativeAdView adView;
    private DaroNativeAd ad;

    private void OnEnable()
    {
        ad = new DaroNativeAd(adUnitId);
        ad.OnAdLoaded += info => adView.Bind(ad);
        ad.OnAdFailedToLoad += error => Debug.LogWarning(error.Message);
        adView.LoadFor(ad);
    }

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