Skip to main content

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.
Native ad elements example

Integrating Ads

1

Prepare Native Ad View

Add DaroNativeAdView to the Unity UI prefab root. Wire TitleText, BodyText, IconImage, CtaButton, and MediaContainer.MediaContainer is optional. When the bound ad has no media asset, DaroNativeAdView hides MediaContainer automatically.Bind(ad) also connects CtaButton taps to the native click flow on Android and iOS.
2

Create Ad Instance

3

Register Event Handlers

4

Load Ad

5

Dispose Ad

For custom uGUI, use ad.WireCtaButton(ctaButton) to connect the actual CTA touch area. If you specified an AdChoices position, also connect the full ad area with ad.WireAdChoices(fullAdRectTransform). Call NotifyVisible() and NotifyHidden() as visibility changes, and receive ad clicks through OnAdClicked rather than the Unity button’s onClick. Calling NotifyClicked() alone does not wire the CTA touch area on a device.
Info.Icon and Info.MediaImage textures are owned by DaroNativeAd and are released when the ad reloads or is disposed. Do not retain or reuse those textures after Unbind() and Dispose().

Loading, visibility, and automatic refresh

LoadFor(ad) loads the ad; call Bind(ad) after loading to display it. On iOS, loading alone does not show the native ad overlay. Deactivating the bound view’s GameObject hides the native overlay and its touch area; reactivating it restores them. Call Unbind() and Dispose() when finished. Automatic refresh follows the server configuration for the Ad Unit. A refresh interval of 0 disables periodic refresh; a positive interval enables it. Load callbacks may occur again after a single Load() call; this is not an error by itself. You do not need a separate ad instance for every refresh. Use the example’s OnAdLoaded handler to bind the latest ad, and receive clicks through OnAdClicked.

AdChoices placement

Starting with 0.5.0-rc.4, you can specify the position in the constructor.
Available positions are TopLeft, TopRight, BottomRight, and BottomLeft. Placement uses the entire RectTransform of DaroNativeAdView, so size it to cover the full ad area. The CTA and AdChoices areas are separate. The existing constructor without a position preserves the default placement.
The AdChoices UI supplied by individual ad demand sources may not follow the requested position. Some iOS ads have been observed displaying it on the right even when a left position was requested. Verify placement and touch behavior with the demand sources and screen orientations you use.

Example

Adapt the UI to received assets

  • Use DaroNativeAd.OnNativeAdAssetLoaded to handle missing assets.
  • The event type is Action<ISet<NativeAdAssetType>>. You can also read ISet<NativeAdAssetType> from ad.Info.AssetTypes.
  • iconContainer is your icon UI container.
  • Advertiser reports availability only; there is no advertiser-name field in Info or dedicated view slot.
  • Media is a receipt signal from the native SDK. Unity media texture delivery is unsupported, so do not assume Info.MediaImage exists based on this value.