how to use reCaptcha in ReactNative app?

南笙酒味 提交于 2019-12-13 03:32:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!