Estoy tratando de implementar recaptcha en la web de la exposición, pero sigo recibiendo errores. ¿Cómo implemento recaptcha en expo web? ¿Uso html y scripts?
Intenté usar Webview (react-native-web-webview) y agregué la configuración en webpack.config pero sigo recibiendo el error No se pueden leer las propiedades de undefined (leyendo 'postMessage')
Nota: react-native-web-webview usa iframe para web.
import WebView from 'react-native-webview'; const getWebviewContent = () => { var originalForm = '<!DOCTYPE html><html><head><script src="https://www.google.com/recaptcha/api.js"></script></head><body><form action="[POST_URL]" method="post"><input type="hidden" value="[TITLE]"><input type="hidden" value="[DESCRIPTION]"><input type="hidden" value="[URL]"><div class="g-recaptcha" data-sitekey="<site-key>"></div><input type="submit" value="Send"/></form></body></html>' var tmp = originalForm .replace("[POST_URL]", "http://localhost:19006/Contact") .replace("[TITLE]", 'title') .replace("[DESCRIPTION]", 'description') .replace("[URL]", 'http://localhost:19006/Contact'); return tmp; } <WebView javaScriptEnabled={true} mixedContentMode={'always'} style={{ height: 500, width: 500 }} source={{ html: getWebviewContent(), baseUrl: '<domain>' // <-- SET YOUR DOMAIN HERE }} />También he intentado usar bibliotecas y sigo recibiendo el mismo error.
import Recaptcha from 'react-native-recaptcha-that-works'; <Recaptcha ref={recaptcha} siteKey="<site-key>" baseUrl="http://localhost:19006/Contact" onVerify={onVerify} onExpire={onExpire} onError={(err) => { alert('onError event'); console.warn(JSON.stringify(err)); }} size="normal" />