acsant / react-native-recaptcha

A react native wrapper for google recaptcha v3
MIT License
39 stars 48 forks source link

Unhandled promise rejection Error: Unable to open URL: about:blank #6

Closed ribuluo000 closed 5 years ago

ribuluo000 commented 5 years ago

demo

    render() {

      //https://github.com/facebook/react-native/issues/19986 webview
      const re_captcha_props = {
        url:config.re_captcha_url,
        reCaptchaType:1,
        action:'verify',
        siteKey:config.re_captcha_site_key,
        onExecute:(result)=>{
          console.log('re_captcha_props.onExecute',result);
          alert('onExecute'+JSON.stringify(result));
        },
        onReady:()=>{
          alert('onReady');
          console.log('re_captcha_props.onReady');
        },
      };

      return (
        <View>
          <ReCaptcha
          {...re_captcha_props} />
        </View>
      );

    }

config:

  re_captcha_site_key:'your key',
  re_captcha_url:'http://127.0.0.1/',

error:

react-native-recaptcha-error-unable-to-open-url

ribuluo000 commented 5 years ago

solution: add this line to react-native-recaptcha-v3/index.js line:125,

originWhitelist={['*']}

react-native-recaptcha-solution-unable-to-open-url