首页 > 解决方案 > FlutterFire - 在哪里获取验证码 # 通过 FirebaseAuth 上的电子邮件

问题描述

我是使用 FIrebase 的新手
随着重大更新,FlutterFire 添加了新方法

NEW: Added support for applyActionCode().  
NEW: Added support for checkActionCode().  
NEW: Added support for verifyPasswordResetCode().

并在文档https://firebase.flutter.dev/docs/auth/usage/

User user = FirebaseAuth.instance.currentUser;
if (!user.emailVerified) {
   await user.sendEmailVerification();
}

//Firebase will send an automated email to the user with a unique code. 
//This code can then be entered via the applyActionCode() method. 
//You can first check whether the code is valid by using the checkActionCode() method:  

等待用户.sendEmailVerification(); 这只会将验证链接发送到用户电子邮件进行验证。不是验证码。

我应该怎么做才能通过电子邮件接收该代码?所以我可以使用方法verifyPasswordResetCode()。. 谢谢

标签: firebaseflutterfirebase-authentication

解决方案


推荐阅读