Skip to main content

Native Ad Format

  • Unlike other ad formats where the ad monetization SDK implements the ad view, native ads provide ad components for you to build the ad view directly.
  • The key advantage is minimizing disruption by implementing layouts based on your UI/UX. However, you must include ad markers to prevent users from confusing ads with content.
Native Example Elements En Pn
4 Required Native Ad ElementsNative ads can be freely designed to match your app’s UI, but the following 4 elements are mandatory:
  1. Ad Label: Add “AD” or similar text so users clearly recognize it as an advertisement.
  2. AdChoices Icon: The AdChoices overlay icon enables users to identify and control ads, typically displayed as an ’ⓘ’ icon. This icon is automatically added by the DARO SDK, so no separate implementation is required. It is placed in one of the four corners of the ad view (top-left, top-right, bottom-right, bottom-left), with bottom-right as the default. You can pick the corner via the preferredAdChoicesPosition option (see the AdChoices Position section below). Please lay out your ad view so the selected corner is not overlapped or obscured by other UI elements. The icon’s appearance and behavior may vary depending on the ad source (demand).
  3. Ad Title: Display the ad’s headline.
  4. CTA (Call to Action): Include a CTA button such as “Install”, “Open”, “Download”. The size and format are flexible.

Registering Native Factory

The layouts below include a persistent AD label supplied by your app. Size the ad container for the actual content and font size, and verify on devices that AdChoices in any corner does not overlap the label or buttons and that content is not clipped. The AD label is separate from the ad assets. To use native ads in Flutter, you must register a native ad factory on the native platform (iOS/Android). The factoryId is the identifier of the factory registered on the native platform.
1

Create Ad Layout XML

Create a native ad layout file in android/app/src/main/res/layout/.ad_badge is a View ID in your app’s example XML, not a fixed SDK resource or a Dart widget property. You can change its style and position in this XML; keep the AD label visible and clear of AdChoices.
sample_native_ad.xml
2

Implement DaroNativeAdFactory

Create a class that implements the DaroNativeAdFactory interface.
SampleNativeAdFactory.kt
3

Register Factory in MainActivity

Register the factory in configureFlutterEngine of your MainActivity.
MainActivity.kt
The factoryId passed to DaroNativeAd must exactly match the factory ID registered on the native platform.

Implementing Native Ads

Native ads follow a Create Ad object → Load → Display widget → Dispose pattern.

1. Create Ad Object

Create a DaroNativeAd object and configure callbacks.

2. Load the Ad

3. Display the Widget

After the onAdLoaded callback fires, place the DaroNativeAdWidget in the widget tree.
Placing DaroNativeAdWidget in the widget tree before calling ad.load() will throw a FlutterError. Always mount the widget after the onAdLoaded callback.

4. Dispose Resources

Call dispose() to clean up resources when leaving the page or when the ad is no longer needed.

Callback Reference


AdChoices Position

The preferredAdChoicesPosition option on DaroNativeAd lets you choose which corner the AdChoices icon renders in. When not specified, the bottom-right corner (bottomRight) is used. Supported on both iOS and Android (daro_flutter 1.0.3+).
Supported values: topLeft, topRight, bottomLeft, bottomRight.
Fixed at construction timepreferredAdChoicesPosition is fixed when the DaroNativeAd instance is created and cannot be changed afterwards. To use a different position, create a new ad instance.
Behavior varies by demand (preferred, not guaranteed)preferredAdChoicesPosition is a preferred-position hint passed to the underlying ad demand. The corner where the AdChoices icon actually renders depends on the implementation of the demand that fills the ad:
  • Some demands honor the option as-is.
  • Some demands ignore the option and enforce their own fixed position.
  • Some demands replace the AdChoices icon with their own privacy control (such as a demand-specific ad badge).
Keep your AD label and the ad demand source’s AdChoices control visible and unobstructed. This position option alone does not guarantee compliance with all advertising requirements. When designing your ad view layout, assume the AdChoices icon or ad badge can appear in any of the four corners and reserve sufficient padding accordingly.

LINE Native Ads

  • LINE native ads are compact native ad formats designed to be naturally inserted into feeds or lists.
  • They are more compact than standard native ads, ideal for embedding between list items.
  • The ad height is fixed at 36dp (Android) / 36pt (iOS).
  • Styles can be customized to match your app’s UI.
LINE Native Ad Example

Implementing LINE Native Ads

LINE native ads follow the same Create Ad object → Load → Display widget → Dispose pattern.

1. Create Ad Object

2. Load the Ad

3. Display the Widget

Placing DaroLineNativeAdWidget in the widget tree before calling ad.load() will throw a FlutterError. Always mount the widget after the onAdLoaded callback.

4. Dispose Resources

Callback Reference

Style Customization

Use DaroLineNativeAdStyle to customize LINE native ad colors. Pass the style when creating the DaroLineNativeAd object.

Style Properties

Adapt the UI to received assets

  • Use onNativeAdAssetLoaded on DaroNativeAd or DaroLineNativeAd to handle missing assets.
  • The callback receives Set<NativeAdAssetType>.
  • Add this code to your State class and call initializeNativeAd() after super.initState() in initState(). Keep your existing loading and widget display flow.