Issue
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
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);
}
}
Solution
SendEmailVerification(Async)
is a method on an FirebaseUser
instance:
Example (using Xamarin async wrappers):
auth = FirebaseAuth.Instance;
using (var authResult = await auth.CreateUserWithEmailAndPasswordAsync("[email protected]", "stackoverflow"))
using (var user = authResult.User)
using (var actionCode = ActionCodeSettings.NewBuilder().SetAndroidPackageName(PackageName,true, "0").Build())
{
await user.SendEmailVerificationAsync(actionCode);
}
Answered By - SushiHangover
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.