React Native Google Captcha showing white blank screen in webview

401 views Asked by At

I am trying to implement google captcha using webview in react native but it showing white screen when application get loaded. I tried but not able to resolve this issue, Could someone please help me how to resolve this issue.

Thanks

 <WebView
  automaticallyAdjustContentInsets={false}
  source={{
    html: `
       <div
        <script src="https://www.google.com/recaptcha/api.js?render=6Lel4Z4UAAAAAOa8LO1Q9mqKRUiMYl_00o5mXJrR" async defer ></script>

        <div class="g-recaptcha" data-sitekey="6Lel4Z4UAAAAAOa8LO1Q9mqKRUiMYl_00o5mXJrR"></div>
                   `,
  }}
  style={{ marginTop: 30, height: 130, width: Dimensions.get("window").width }}
/>;
1

There are 1 answers

0
Srihari On

Webview just shows the content from the URL.

When I paste your link into the browser. I am getting the below error. Try with another URL. check my code for more reference.

Bad Request
Error 400

That is the reason your Webview getting a white blank screen.

import React, { Component } from 'react';
import { WebView } from 'react-native-webview';

class MyWebComponent extends Component {
  render() {
    return <WebView source={{ uri: 'https://reactnative.dev/' }} />;
  }
}