Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!