Skip to main content

Overview

Native ads are customizable ads that blend naturally with your app’s content. You can configure the ad to match your app’s UI using AdropNativeAd and AdropNativeAdView.

Key Features

  • Customizable layout to match app design
  • Provides various elements like headline, body, CTA button, profile, etc.
  • Supports image and HTML creative
  • Custom click handling support
  • Backfill ad support
Use the test unit ID in development: PUBLIC_TEST_UNIT_ID_NATIVE

AdropNativeAd

Constructor

Parameters

Properties

Methods

Call dispose() when the native ad is no longer displayed. Failing to dispose leaks the native WebView and can lead to OOM in feed-style screens.
A disposed AdropNativeAd cannot be reused. To request another ad, create a new AdropNativeAd instance.

AdropNativeAdView

A widget that displays native ads on screen.

Constructor

Parameters

AdropNativeProperties

Content properties of the native ad.

Properties

AdropNativeProfile


Basic Usage


AdropNativeListener

Listener to handle native ad events.

Callbacks

Callback Descriptions


Custom Click Handling

Use useCustomClick when video creative or custom click behavior is needed.
When useCustomClick is true, child widget click events are handled as ad clicks.

Displaying HTML Creative

If the native ad includes HTML creative, you can display it using WebView.
For video native creatives, you must render properties.creative (the HTML payload) through a WebView. Passing properties.asset directly into video_player or any other custom player bypasses the SDK’s video tracking pipeline, so VTR is not measured and onAdVideoStart / onAdVideoEnd never fire. See Video Tracking and VTR.
To use HTML creative, you need to add the webview_flutter package.

Handling Backfill Ads

You can check and handle backfill ads using the isBackfilled property.

AdChoices Position

For backfill native ads, you can choose which corner displays the AdChoices badge. Set preferredAdChoicesPosition in the AdropNativeAd constructor.
This setting is a preferred hint for the backfill network and applies only to backfill native ads — direct ads are not affected. The backfill network may override the position depending on its policy.

Video Tracking and VTR

Adrop measures video metrics for native creatives — including impression-to-completion (VTR), onAdVideoStart, and onAdVideoEnd — only when the video is rendered through the SDK’s media surface. On Flutter, that means rendering the HTML creative (properties.creative) inside a WebView, as shown in Displaying HTML Creative. The properties.asset field returns a URL pointing to the underlying image or video file. It is exposed as supplementary metadata (for example, for thumbnails or your own analytics); it is not intended to drive playback.
Do not feed the properties.asset URL into a custom video player (video_player, chewie, or any third-party player) for a video native ad. When the SDK’s media surface is bypassed:
  • VTR (Video Through Rate) is not collected for that placement.
  • onAdVideoStart / onAdVideoEnd callbacks never fire.
  • Aggregate video performance for the unit will under-report or report zero.
Click (onAdClicked) and impression (onAdImpression) tracking still work because they are wired to AdropNativeAdView, but the video-specific signals are lost.
For video creatives, follow the WebView + HTML creative pattern:
Bind the WebView inside AdropNativeAdView so that click and impression tracking stay attached to the ad container.
If a placement absolutely requires a custom player and you accept that VTR will not be measured, you can still surface click and impression attribution by keeping the ad bound to AdropNativeAdView. In that case, treat the placement as non-VTR inventory in your internal reporting and avoid mixing it with SDK-measured video performance.

Using Extra Fields

Additional fields defined by publishers can be accessed from the extra map.

Error Handling

When backfill ads are configured, the backfillNoFill error code is returned when both direct ads and backfill ads are unavailable.

General Error Handling


Best Practices

1. Recreating Ads

To load a new ad, create a new AdropNativeAd instance.

2. Conditional Rendering

Display an appropriate placeholder until the ad loads.

3. Responsive Layout

Configure layout to adapt to various screen sizes.

4. Null Check for Ad Properties

Native ad properties can be null, so always check them.

Next Steps

Interstitial Ads

Implement full-screen interstitial ads

Rewarded Ads

Implement rewarded ads that provide rewards

Popup Ads

Implement popup-style ads

Reference

Reference types, methods, and error codes