Overview
Banner ads are rectangular ads displayed in a portion of the screen. They can be easily implemented using theAdropBannerView widget.
Key Features
- Can be fixed at the top, bottom, or middle of the screen
- Supports image and video ads
- Handle ad events through callbacks
- Provides ad metadata (creative ID, campaign ID, etc.)
Use the test unit ID for development:
PUBLIC_TEST_UNIT_ID_320_100AdropBannerView
Constructor
Properties
Methods
Basic Usage
AdropBannerListener
A listener that handles banner ad events.Callbacks
Callback Descriptions
Metadata
You can receive metadata in theonAdReceived, onAdClicked, and onAdImpression callbacks.
Creative size is accessed via
bannerView.creativeSize?.width and bannerView.creativeSize?.height, not through metadata.Ad Sizes
Banner ads require specifying container size according to the unit settings.Common Banner Sizes
Fixed Size Usage
Fit to Screen Width
Size Configuration
You can explicitly set the banner view size using theadSize property.
Error Handling
Implement proper error handling when ad loading fails.Best Practices
1. Release Resources
Always calldispose() when the banner view is no longer needed.
2. Refresh Ads
You can refresh ads as needed.3. Conditional Rendering
Hide the banner area or show a placeholder until the ad loads.4. Managing Multiple Banners
When using multiple banners, manage each state separately.Complete Example
Backfill Ads
When backfill ads are enabled, backfill ads are automatically loaded when direct ads are unavailable. Backfill ad loading is handled automatically by the SDK. You can handle backfill-related errors using thebackfillNoFill error code.
Banner ad metadata only includes the
creativeId, txId, campaignId, destinationURL, and browserTarget fields. Backfill ads cannot be distinguished through metadata. You can detect backfill ad failures using the backfillNoFill error code.To use backfill ads, add the backfill dependency to native platforms. See Getting Started.
Next Steps
Native Ads
Implement customizable native ads that match your UI
Interstitial Ads
Implement full-screen interstitial ads
Popup Ads
Implement popup-style ads
Reference
View types, methods, and error codes