jarden-digital / react-native-recaptchav3

Haskkor/react-native-recaptchav3
MIT License
48 stars 77 forks source link

App crashing on android #23

Open pierroo opened 2 years ago

pierroo commented 2 years ago

On an emulator, it crashes so hard when I add the ReCaptchaV3 that I can't get much information. However, when doing an adb logcat here is the line that explains the crash:

06-24 11:45:44.708  9159  9159 F crashpad: dlopen: dlopen failed: library "libandroidicu.so" not found: needed by /system/lib/libharfbuzz_ng.so in namespace (default)
06-24 11:45:44.708  8880  8951 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c in tid 8951 (RenderThread), pid 8880 (pckg.name)

I did install webview (^11.22.3), using latest version of this package; using react native 0.66.0

I'm at loss of solution, any help would be appreciated!

EDIT: additional info:

When I add a timeout before displaying the Captcha component, then it works properly.

For example:

useEffect(() => {
    setTimeout(() => {
      setIsShow(true)
    }, 1500)
  }, [])

coupled with:

{
        isShowCaptch ? (
          <ReCaptchaV3
            captchaDomain={'com.bottledapp.bottled'}
            siteKey={'6LcuGZkgAAAAAHhytxp13G-CGMGxRuDmPMc9NtMk'}
            onReceiveToken={(token) => {
              console.log('CAPTCHA TOKEN IS: ', token)
              captchaRef.current = token
            }}
          />
        ) : null
      }

Then it works. But it sounds very hacky and not something I should rely on; any explaination why I would need to wait for the page to be fully mounted before I can display the captcha v3?

Edit again:

Could it be related to some kind of race conditions as mentioned at the end of this doc? https://developers.google.com/recaptcha/docs/v3

pierroo commented 2 years ago

@jeremy-farnault is this package maintained? Even if the answer is no, please let me know :) Thank you!

amitmehtacode commented 6 months ago

Use this

https://www.npmjs.com/package/react-native-secure-captcha-v3