问题
I have found following lib for use reCaptcha in RN app
https://www.npmjs.com/package/react-native-recaptcha
my code is
import ReCaptcha from 'react-native-recaptcha';
...
<View style={{ flex: 1}}>
<ReCaptcha
sitekey={'test'}
/>
</View>
but no recaptcha is displayed. Also I have tried sitekey used in one of my websites where reCaptcha worked properly - still nothing. Do I miss something?
p.s. github of this lib not exists (
回答1:
I think there is no lib exist for reCaptcha in react native. So you need to use wrapped webview for it, I know it is slow and may include your requirment, but I think it is only solution.
Please see React Native with reCATPCHA and https://github.com/evenchange4/react-grecaptcha
回答2:
I recently wrote a component that does something similar to what Priya suggested. It caters specifically to react-native and uses google recaptcha v3. Feel free to check it out and make a PR if you would like to customize it or feel that something could be done better :)
https://www.npmjs.com/package/react-native-recaptcha-v3
来源:https://stackoverflow.com/questions/50069531/how-to-use-recaptcha-in-reactnative-app