如何使用 flutter web 从 Firebase 电话身份验证中删除验证码验证? [英] How to remove captcha verification from Firebase phone auth using flutter web?

查看:38
本文介绍了如何使用 flutter web 从 Firebase 电话身份验证中删除验证码验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除或制作不可见的 google recaptcha 验证.我的验证手机号码和登录的代码

I wants to remove or a make invisible google recaptcha verfication. My code for verifying mobile number and sign in

await FirebaseAuth.instance.verifyPhoneNumber(
    phoneNumber: "+91${customMobileController.text.toString()}",
    timeout: const Duration(seconds: 5),
    verificationCompleted: verificationCompleted,
    verificationFailed: verificationFailed,
    codeSent: codeSent,
    codeAutoRetrievalTimeout: codeAutoRetrievalTimeout);

用于登录

var authCredential = PhoneAuthProvider.getCredential(
    verificationId: verificationId,
    smsCode: otp,
);

await FirebaseAuth.instance
    .signInWithCredential(authCredential)
    .then((value) {})
    .catchError((error) {});

推荐答案

您可以通过在 Google 云控制台上的项目中启用 Android 设备验证 API 来删除 reCaptcha.你可以通过在那里添加你的项目来做到这一点.

You can remove reCaptcha by Enabling the Android Device Verification API in Your Project on google cloud console. You can do that by Adding Your Project there.

之后,您还应该在项目设置中的 Firebase 项目中添加 SHA-256 密钥.

After that you should also add SHA-256 key in Your Firebase Project in Project Setting.

现在将没有 reCaptchaa 来验证您不是机器人.

Now there will be no reCaptchaa to verify to that your are not a robot.

这篇关于如何使用 flutter web 从 Firebase 电话身份验证中删除验证码验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆