0

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 Answer 1

0

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/' }} />;
  }
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.