Search code examples
javascriptcordovaphonegap-buildrecaptcha

reCaptcha usage in cordova/phonegap application


I am trying to integrate google recaptcha with cordova html5 application. But cordova uses file protocol in the application. So using captcha in the app gives "Error: invalid domain for site key".

I am using cordova 3.5.0 for building the application and <access origin="*" /> is added in config.xml.

Is recaptcha can be used only for web applications and not for hybrid/native aapplications?


Solution

  • reCaptcha cannot be used directly in a cordova project because of protocol issues. Either

    -we have to load reCaptcha url in a separate webview

    -Use secure token way of loading reCaptcha that they introduced recently (https://developers.google.com/recaptcha/docs/secure_token)