메인 콘텐츠로 건너뛰기

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.

네이티브 광고 형태 소개

  • 앱 UI에 맞게 광고 자산을 직접 배치하는 광고입니다.
  • Unity UI 프리팹에 DaroNativeAdView를 붙여 슬롯을 연결하거나, DaroNativeAd.Info를 직접 읽어 커스텀 UI에 바인딩할 수 있습니다.

광고 연동하기

1

Native Ad View 준비

Unity UI 프리팹 루트에 DaroNativeAdView를 추가하고 TitleText, BodyText, IconImage, CtaButton, MediaContainer 슬롯을 연결합니다.
2

광고 인스턴스 생성

private DaroNativeAd ad;
[SerializeField] private DaroNativeAdView adView;

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

이벤트 핸들러 등록

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

광고 로드

adView.LoadFor(ad);
5

광고 해제

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;
    }
}