Skip to main content

Overview

Display backfill ads in WebView within your React Native app. The Adrop SDK provides a useAdropWebView hook for easy integration, as well as a manual registerWebView API.

Prerequisites

Install the react-native-webview package in your project.
WebView backfill ads require adrop-ads-backfill to be configured on both Android and iOS. See Getting Started for setup instructions.

Platform Configuration

Configure the native platforms to enable backfill ads in WebView.
Add the following to android/app/src/main/AndroidManifest.xml:
AndroidManifest.xml
This configuration is required for backfill ads to work properly in WebView. Without it, backfill ads may not display.

Using useAdropWebView Hook

The recommended approach. The useAdropWebView hook handles WebView registration automatically.
Return values:
Load web content only after isReady is true. Before registration is complete, passing a URL to the WebView may result in ads not displaying.

Manual Registration

You can also register the WebView manually using Adrop.registerWebView.
react-native-webview’s ref is an imperative handle, so findNodeHandle does not work directly on it. You must wrap the WebView in a View and use that View’s ref instead.

WebView Configuration

The following WebView props are required for backfill ads to work properly:

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 user-initiated navigations to an external browser.
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.

Banner Ads

Learn how to integrate banner ads

Reference

API reference

Examples

Example repository