Skip to main content

Overview

Native ads are ad formats that naturally integrate with your app’s UI. You can freely customize ad elements (title, image, description, etc.) to match your app design.

Key Features

  • Custom design that perfectly integrates with app UI
  • Individual access and placement of ad elements
  • Option to display advertiser profile information
  • Support for additional custom fields

Implementation Steps

Native ad implementation proceeds in the following steps:
  1. Load ad
  2. Create custom view
  3. Bind view
  4. Handle delegates

1. Load Ad

Create an AdropNativeAd instance and load the ad.

Set Context ID

You can set a Context ID for contextual targeting.
Use test unit IDs during development. See the Test Unit IDs section.

2. Create Custom View

Compose your native ad view using Storyboard or code.

UIKit (Storyboard/XIB)

Create AdropNativeAdView in Storyboard and connect ad elements as IBOutlets.

UIKit (Code)


3. Bind View

Bind ad elements to AdropNativeAdView to display ad data.

Binding Methods

The onClick closure is called when the user taps the bound view. It receives the current AdropNativeAd? instance and the tapped UIView as parameters. If not provided, the default click behavior (opening the destination URL) is used.
To display advertiser profile, you must enable Show Advertiser Profile for the ad unit in Ad Control Console.

4. Handle Delegates

Implement AdropNativeAdDelegate to handle ad events.

Delegate Methods


Closure Callbacks

As an alternative to delegates, you can use closure-based callbacks.
If both a delegate and closures are set, both will be called.

Ad Properties

You can access ad data through the AdropNativeAd object.

Basic Properties

Advertiser Profile

Custom Fields

You can access additional text items set in Ad Control Console.
The extra field uses additional text item IDs defined in the ad unit settings in Ad Control Console as keys.

Property List

AdropNativeAdProfile


Custom Click

You can use Custom Click to handle ad click behavior yourself instead of using the default behavior (opening the destination URL).

Setup

Entire Click Area

Use setIsEntireClick(_:) to make the entire AdropNativeAdView clickable.
When useCustomClick is true, setIsEntireClick(true) is automatically called in setNativeAd(_:).

Manual Click

Use performClick() to manually trigger a click event.

Open URL

Use open(_:useInAppBrowser:) to open a URL programmatically.

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 (a UIView bound via AdropNativeAdView.setMediaView(_:)). The AdropNativeAd.asset property 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 asset URL into a custom video player (AVPlayer, AVPlayerViewController, 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 the container view, but the video-specific signals are lost.
Bind the SDK media surface for every video native:
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.

Best Practices

Error Handling

Display fallback UI when ad fails to load to maintain user experience.

Test Unit IDs

Use the following test unit IDs during development and testing.
Make sure to use actual unit IDs created in Ad Control Console for production deployment.

Batch Loading (loads)

Use AdropNativeAd.loads(...) to request multiple native ads in a single batched call. This is useful for prefetching a pool of ads to insert into feeds, carousels, or paginated lists.

Signature

Usage

Delegate Methods

The singular onAdReceived(_:) / onAdFailedToReceive(_:_:) callbacks are not invoked on the loads path. Use onAdsReceived(_:) / onAdsFailedToReceive(_:) as the sole batch signals.

Constants

Int
default:"5"
Upper bound on ads returned from a single loads(...) call.

Constraints

  • Maximum 5 ads per call. If the server returns more, only the first 5 are delivered.
  • Backfill is not applied. If no direct ads fill, onAdsFailedToReceive is called with ERROR_CODE_AD_NO_FILL regardless of backfill configuration.
  • Unlike AdropBanner.loads(...), the native batch waits for every returned ad to finish rendering before firing onAdsReceived(_:), so each instance is fully rendered on delivery.
  • Hold strong references to the returned ads. If they deallocate before being bound to an AdropNativeAdView, they’re silently dropped.

Backfill Ads

When backfill ads are enabled, backfill ads are automatically loaded when direct ads are unavailable. Use the isBackfilled property to check if the ad is a backfill ad.

AdChoices Position

For backfill native ads, you can choose which corner displays the AdChoices badge. Set preferredAdChoicesPosition on the AdropNativeAd instance before calling load().
This setting is a preferred hint for the backfill network and applies only to backfill native ads — direct ads are not affected. The value must be set before load() is called. The backfill network may override the position depending on its policy.
To use backfill ads, add the AdropAds-Backfill dependency. See Getting Started.

Getting Started

SDK installation and initialization

Banner Ads

Implementing banner ads

Interstitial Ads

Implementing interstitial ads

Rewarded Ads

Implementing rewarded ads