React Native - Recaptcha

问题描述 投票:0回答:0

我正在尝试使用库 Recaptcha-that-works 但它不起作用。我正在使用来自 google recaptcha v2 或 v3 的凭据。只需使用我从在线测试中获取的默认键即可 (https://snack.expo.dev/@douglasjunior/react-native-recaptcha-that-works?platform=android)

`import Recaptcha  from 'react-native-recaptcha-that-works';
const $recaptcha = useRef();

<Recaptcha
        ref={$recaptcha}
        lang="en"
        headerComponent={<Button title="Close" onPress={handleClosePress} />}
        siteKey="..."
        baseUrl="http://127.0.0.1"
        size={size}
        theme="light"
        onLoad={() => alert('onLoad event')}
        onClose={() => alert('onClose event')} 
        onError={(err) => {
          console.warn('error', err);
          alert('onError event');
        }}
        onExpire={() => alert('onExpire event')}
        onVerify={(token) => {
          alert('onVerify event');
          console.log('Este es el token',token);
          setKey(token);
        }}`

我认为我不了解 Google Recaptcha 的工作原理。

我尝试使用来自 Google Recaptcha v3 和 v2 的密钥,但我在验证密钥时收到错误“Null”。该库是 React-Native-That-Works

react-native recaptcha
© www.soinside.com 2019 - 2024. All rights reserved.