c# - Xamarin Firebase 发送电子邮件验证
问题描述
美好的一天,注册帐户后如何在 Xamarin 上发送电子邮件验证我正在使用此代码,但sendEmailVerification
其中说 FirebaseAuth 没有定义sendEmailVerification
我怎样才能解决这个问题?
private void LoginUser(string email, string password){
if (input_password.Text == reinput_password.Text){
auth.CreateUserWithEmailAndPassword(email, password)
.AddOnCompleteListener(this, this);
auth.sendEmailVerification(email)
.AddOnCompleteListener(this, this);
}
}
解决方案
SendEmailVerification(Async)
是FirebaseUser
实例上的方法:
示例(使用 Xamarin 异步包装器):
auth = FirebaseAuth.Instance;
using (var authResult = await auth.CreateUserWithEmailAndPasswordAsync("so@sushi.com", "stackoverflow"))
using (var user = authResult.User)
using (var actionCode = ActionCodeSettings.NewBuilder().SetAndroidPackageName(PackageName,true, "0").Build())
{
await user.SendEmailVerificationAsync(actionCode);
}
推荐阅读
- java - Spring Data Mongo 找不到 Enum 的 PersistentEntity
- javascript - 了解 Django/REST/JS 代码功能
- c++ - C++ winsock 服务器接受函数返回 10022 错误
- c++ - 从终端手动运行时,我的项目找不到它的库
- javascript - 通过 JavaScript 动态添加 MDL 文本输入,而不是通过 AJAX
- gnuplot - gnuplot 没有在 y 轴上显示一个圆圈的正确比例
- android - 为什么我的 xml、gradle 和 value 文件会自行改变?
- php - 在for循环中显示一个月中每一天的记录数以显示该月的日期
- c# - Microsoft Graph API 超时异常
- kendo-ui - 防止 kendo ui 图表工具提示在图表刷新后消失