The webViewIdentifier is extracted differently per platform:
Platform
Controller
Property
Android
AndroidWebViewController
.webViewIdentifier
iOS
WebKitWebViewController
.webViewIdentifier
if (Platform.isAndroid) { identifier = (_controller.platform as AndroidWebViewController).webViewIdentifier;} else if (Platform.isIOS) { identifier = (_controller.platform as WebKitWebViewController).webViewIdentifier;}
Call Adrop.registerWebView() before loading any web content. Load the URL only after registration is complete.
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.
import 'package:url_launcher/url_launcher.dart';const allowedHost = 'my-domain.com';_controller = WebViewController.fromPlatformCreationParams(params) ..setJavaScriptMode(JavaScriptMode.unrestricted) ..setNavigationDelegate( NavigationDelegate( onNavigationRequest: (NavigationRequest request) { final host = Uri.parse(request.url).host; // Only redirect main frame navigations to external browser // Ad resources (e.g., googleads.g.doubleclick.net) load via iframes/scripts — // do not block them if (!host.contains(allowedHost) && request.isMainFrame) { launchUrl(Uri.parse(request.url), mode: LaunchMode.externalApplication); return NavigationDecision.prevent; } return NavigationDecision.navigate; }, ), );
Do not block or redirect all non-own-domain requests. Ad resources like googleads.g.doubleclick.net are loaded automatically during the backfill ad process and must be allowed to load within the WebView.