This is a cordova plugin to perform Google reCAPTCHA verify on Android using the android SafetyNet package.
Based on cordova-plugin-recaptcha by @pack-internal
We needed to use recaptcha in our app, but using web recaptcha it does not work in Ionic/Cordova, as it does not have a domain name.
And didn't find any plugin for Angular2+ so this comes to fill that hole.
- Get a Key: https://www.google.com/recaptcha/admin
- Must generate a Android key
- Safetynet Recaptcha Docs: https://developer.android.com/training/safetynet/recaptcha
cordova plugin add https://github.com/lucasbasquerotto/cordova-plugin-recaptcha-android
ionViewDidLoad() {
this.platform.ready().then(() => {
(<any>window).IonicRecaptcha.verify('ANDROID_KEY', this.successCallback, this.errorCallback);
});
}
successCallback(data) {
console.log("Good, verified", data);
}
errorCallback(err) {
console.log("Bad, not verified", err);
}