Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
Android React Native WebView loading Recaptcha via script tab doesn't doesn't work

We have the following code being loaded into a WebView in React Native:

<!DOCTYPE html>
<html>
<head>
  <style>
    body {
      display: flex;
      justify-content: left;
      align-items: top;
    }
  </style>
</head>
<body>
  <div id="inline-badge"></div>
  <script src="https://www.google.com/recaptcha/api.js?render=explicit&onload=onRecaptchaLoadCallback"></script>
  <script>
    alert('js is running');
    function onRecaptchaLoadCallback() {
      alert('onRecaptchaLoadCallback loaded');
    }
  </script>
</body>
</html>`

What is expected to happen is the code is loaded for Recaptcha from https://www.google.com. Once loaded the onload=onRecaptchaLoadCallback will call the onRecaptchaLoadCallback function.

This works on iOS. The alert for js is working is show, the after the script is loaded, the onRecaptchaLoadCallback function is called (and shows the alert contents)

On Android, we only get the first alert, but the onRecaptchaLoadCallback is never called.

Here is the WebView component code for reference:

<WebView
  nativeID={id}
  style={{ width: 0, height: 0 }}
  originWhitelist={['*']}
  startInLoadingState={true}
  javaScriptEnabledAndroid={true}
  javaScriptEnabled={true}
  domStorageEnabled={true}
  mixedContentMode="always"
  allowUniversalAccessFromFileURLs={true}
  source={{ html: recaptchaHtmlWithKey, baseUrl: 'https://www.our-site-url.com' }}
  onMessage={(event) => {
    onCheck(event.nativeEvent.data)
  }}
/>

Also to note, we do have the INTERNET permission set in the android gradle file.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda