Overview
Native ads are an ad format that allows you to freely customize the ad UI to match your app’s design. You can individually place ad elements such as media (images, videos), title, description, and CTA button to provide a natural user experience.Key Features
- Complete UI Customization: Freely configure ad layout to match your app’s design system
- Support for Various Media: Support for image and video ad materials
- Flexible Click Handling: Full click or custom click handling available
- Profile Information Display: Support for advertiser profile logo and name
- Backfill Ad Support: Can check if it’s a backfill ad
AdropNativeAd Class
The main class for loading and managing native ads.Constructor
Ad unit ID (issued from console)
Whether to use custom click handling
true: Developer implements click handling directly (can use video ad controller)false: AdropNativeAdView automatically handles all click events
AdChoices badge position for backfill native ads
Methods
| Method | Description |
|---|---|
load() | Request and load the ad |
destroy() | Release ad resources |
Properties
| Property | Type | Description |
|---|---|---|
isLoaded | boolean | Whether ad is loaded (read-only) |
unitId | string | Ad unit ID (read-only) |
useCustomClick | boolean | Whether custom click handling is used (read-only) |
creativeId | string | Ad creative ID (read-only) |
txId | string | Transaction ID (read-only) |
campaignId | string | Campaign ID (read-only) |
isBackfilled | boolean | Whether it’s a backfill ad (read-only) |
isVideoAd | boolean | Whether it’s a video ad (read-only) |
browserTarget | BrowserTarget | Browser target setting (read-only) |
properties | AdropNativeProperties | Ad properties information (read-only) |
listener | AdropNativeAdListener | Ad event listener |
AdropNativeAdView Component
Container component to display native ads.Props
Native ad instance to display
Usage Example
AdropNativeAdView provides ad context, so all ad element views must be placed inside this component.Native Ad Element Views
AdropProfileLogoView
Image component to display advertiser profile logo.Omit<ImageProps, 'source'> (React Native Image component properties, source is auto-populated)
AdropProfileNameView
Text component to display advertiser profile name.TextProps (React Native Text component properties)
AdropHeadLineView
Text component to display ad title.TextProps (React Native Text component properties)
AdropBodyView
Text component to display ad body text.TextProps (React Native Text component properties)
AdropMediaView
Media component to display ad image or video.ViewProps (React Native View component properties)
AdropCallToActionView
Text component to display call-to-action (CTA) message.TextProps (React Native Text component properties)
AdropAdvertiserView
Text component to display advertiser name.TextProps (React Native Text component properties)
AdropIconView
Image component to display ad icon.Omit<ImageProps, 'source'> (React Native Image component properties, source is auto-populated)
AdropNativeAdListener Interface
Listener interface for handling ad events.| Callback Method | Description |
|---|---|
onAdReceived | Called when ad reception is successful |
onAdClicked | Called when ad is clicked |
onAdImpression | Called when ad is displayed |
onAdFailedToReceive | Called when ad reception fails |
onAdVideoStart | Called when a video ad starts playing |
onAdVideoEnd | Called when a video ad finishes playing |
AdropNativeProperties Type
Type containing ad properties information.AdropNativeProfile Type
Type containing advertiser profile information.Implementation Example
Here’s a complete example of implementing native ads.Test Unit IDs
Use the following test unit IDs during development and testing.| Platform | Format | Test Unit ID |
|---|---|---|
| Android/iOS | Native (Image) | PUBLIC_TEST_UNIT_ID_NATIVE |
| Android/iOS | Native Video (16:9) | PUBLIC_TEST_UNIT_ID_NATIVE_VIDEO_16_9 |
| Android/iOS | Native Video (9:16) | PUBLIC_TEST_UNIT_ID_NATIVE_VIDEO_9_16 |
Error Handling
When ad loading fails, you can receive error codes in theonAdFailedToReceive callback.
Common Error Codes
| Error Code | Description |
|---|---|
AdropErrorCode.network | Network error |
AdropErrorCode.internal | Internal error |
AdropErrorCode.initialize | Initialization error |
AdropErrorCode.invalidUnit | Invalid unit ID |
AdropErrorCode.adNoFill | No ads available |
AdropErrorCode.adLoading | Ad is loading |
AdropErrorCode.backfillNoFill | No backfill ads available |
Error Handling Example
Best Practices
1. Resource Cleanup
Always release ad resources when component unmounts.2. Video Ad and Backfill Ad Handling
Choose appropriate rendering method based on whether it’s a video ad or backfill ad.3. URL Handling
Handle URL clicks in WebView to open in external browser.4. Selective Use of Ad Elements
Selectively use only the ad elements needed to match your app’s design.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 React Native, that means rendering the HTML creative (properties.creative) inside a WebView, as shown in the Implementation Example.
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.
Recommended pattern
For video creatives, render the HTML creative inside aWebView placed inside AdropNativeAdView:
isVideoAd and isBackfilled flags on AdropNativeAd let you branch between <AdropMediaView /> (image or backfill creative) and <WebView /> (direct video creative) without inspecting the asset URL yourself.
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.AdChoices Position
For backfill native ads, you can choose which corner displays the AdChoices badge. PasspreferredAdChoicesPosition as the third argument to the AdropNativeAd constructor.
| Value | Description |
|---|---|
AdropAdChoicesPosition.topLeft | Top-left corner |
AdropAdChoicesPosition.topRight | Top-right corner (default) |
AdropAdChoicesPosition.bottomLeft | Bottom-left corner |
AdropAdChoicesPosition.bottomRight | Bottom-right corner |
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.
Next Steps
Banner Ads
Implement banner ads
Interstitial Ads
Implement interstitial ads
Popup Ads
Implement popup ads
Rewarded Ads
Implement rewarded ads