Overview
Display backfill ads in WebView within your Flutter app by registering the WebView with the Adrop SDK usingAdrop.registerWebView.
Prerequisites
Add the following packages to your project:Platform Configuration
Configure the native platforms to enable backfill ads in WebView.- Android
- iOS
Add the following to
android/app/src/main/AndroidManifest.xml:AndroidManifest.xml
Register WebView
Create aWebViewController, extract the platform-specific identifier, and register it with Adrop.registerWebView before loading content.
Getting the WebView Identifier
ThewebViewIdentifier is extracted differently per platform:
| Platform | Controller | Property |
|---|---|---|
| Android | AndroidWebViewController | .webViewIdentifier |
| iOS | WebKitWebViewController | .webViewIdentifier |
Call
Adrop.registerWebView() before loading any web content. Load the URL only after registration is complete.iOS WebView Configuration
For iOS, configure inline media playback usingWebKitWebViewControllerCreationParams:
Handling External URLs
If your app opens non-own-domain URLs in an external browser, you must ensure that ad resource requests (e.g.,googleads.g.doubleclick.net) are not blocked.
Ad resources such as iframes and scripts are loaded automatically by the ad SDK — they are not user-initiated navigations. Only redirect main frame navigations to an external browser.
Related Documentation
Banner Ads
Learn how to integrate banner ads
Reference
API reference
Examples
Example repository