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 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
Prepare Native Ad View
Add DaroNativeAdView to the Unity UI prefab root. Wire TitleText, BodyText, IconImage, CtaButton, and MediaContainer.
Create Ad Instance
private DaroNativeAd ad;
[SerializeField] private DaroNativeAdView adView;
ad = new DaroNativeAd("your-native-ad-unit-id");
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");
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;
}
}