[英]Xamarin Firebase Sending Email Verification
good day how to send an email verification on Xamarin after you register an account I'm using this code but in sendEmailVerification
it said FirebaseAuth does not define sendEmailVerification
美好的一天如何在注册帐户后在 Xamarin 上发送电子邮件验证我正在使用此代码但在
sendEmailVerification
它说 FirebaseAuth 未定义sendEmailVerification
how can I fix this?我怎样才能解决这个问题?
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)
is a method on an FirebaseUser
instance: SendEmailVerification(Async)
是FirebaseUser
实例上的一个方法:
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);
}
my code works but there is something wrong IsEmailVerified always false我的代码有效但有问题 IsEmailVerified 总是错误
var authProvider = new FirebaseAuthProvider(new FirebaseConfig(webapi));
var auth = await authProvider.SignInWithEmailAndPasswordAsync(emailtxt.Text, passwordtxt.Text);
string gettoken = auth.FirebaseToken;
var content = await auth.GetFreshAuthAsync();
var serializedcontnet = JsonConvert.SerializeObject(content);
Preferences.Set("MyFirebaseRefreshToken", serializedcontnet);
if(content.User.IsEmailVerified == false)
{
var action = await App.Current.MainPage.DisplayAlert("Alert", "Your Email not activated,Do You want to Send Activation Code again?!", "Yes","No");
if(action)
{
await authProvider.SendEmailVerificationAsync(gettoken);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.