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
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)
For non-backfill ads, video ads should be rendered directly using WebView. (See implementation example)
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 |
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.Next Steps
Banner Ads
Implement banner ads
Interstitial Ads
Implement interstitial ads
Popup Ads
Implement popup ads
Rewarded Ads
Implement rewarded ads