[英]React Native Google Captcha showing white blank screen in webview
我正在尝试使用 webview 在 React Native 中实现谷歌验证码,但它在应用程序加载时显示白屏。 我试过但无法解决这个问题,请问有人能帮我解决这个问题吗?
谢谢
<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 }}
/>;
Webview 只是显示来自 URL 的内容。
当我将您的链接粘贴到浏览器中时。 我收到以下错误。 尝试使用另一个 URL。查看我的代码以获取更多参考。
Bad Request
Error 400
这就是您的Webview
出现白色空白屏幕的原因。
import React, { Component } from 'react';
import { WebView } from 'react-native-webview';
class MyWebComponent extends Component {
render() {
return <WebView source={{ uri: 'https://reactnative.dev/' }} />;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.