You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose a way to register native WebView instances with Google Mobile Ads SDK WebView API for Ads #3960
Currently, react-native-webview does not appear to expose a way for React Native apps to access or register the underlying native WebView / WKWebView instance with the Google Mobile Ads SDK.
This creates a compliance issue for apps that use react-native-webview to display owned web content that includes AdSense or Google Ad Manager ads.
However, there is no JS prop or imperative method that allows the app to register the native WebView instance with Google Mobile Ads SDK.
This is especially problematic for Expo apps using development builds / EAS builds, where native code can be included but the WebView is still provided by react-native-webview.
Proposed solution
Add first-class support for registering the native WebView with Google Mobile Ads SDK when requested.
or the appropriate Google Mobile Ads SDK equivalent after the WKWebView is created.
Why this belongs here
The Google API must be called with the actual native WebView object.
Because react-native-webview owns creation of the native WebView / WKWebView, this library is in the best position to expose a safe and stable way to perform that registration.
@TOPans No not yet. I'm still trying to figuring it out. Might need to move the whole admob implementation to native SDK, but imho that is not an optimal solution. Two more headache to take care of.
@saif71
This is bad news :(
I'm not an expert in native programming, but with the help of assistants, I came up with a working solution. I'm afraid to use it because of possible problems in a production application. I added this code to the library functions for testing.
react-native-webview 13.16.0
Activity
TOPans commentedon Jul 2, 2026
@saif71
I encountered the same issue, did you find any solution?
saif71 commentedon Jul 2, 2026
@TOPans No not yet. I'm still trying to figuring it out. Might need to move the whole admob implementation to native SDK, but imho that is not an optimal solution. Two more headache to take care of.
TOPans commentedon Jul 6, 2026
@saif71
This is bad news :(
I'm not an expert in native programming, but with the help of assistants, I came up with a working solution. I'm afraid to use it because of possible problems in a production application. I added this code to the library functions for testing.
react-native-webview 13.16.0
Android
react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManagerImpl.kt
fun createViewInstance(context: ThemedReactContext, webView: RNCWebView): RNCWebViewWrapper {
iOs
react-native-webview/apple/RNCWebViewImpl.m
(void)didMoveToWindow
if (self.window != nil && _webView == nil) {
WKWebViewConfiguration *wkWebViewConfig = [self setUpWkWebViewConfig];
_webView = [[RNCWKWebView alloc] initWithFrame:self.bounds configuration: wkWebViewConfig];
ziadsabillah-pelm commentedon Jul 8, 2026
+1
davidteejay commentedon Aug 26, 2026
Here's a patch you can use for this (for 13.16.1):
Usage: