public void RequestVerifyCodeWithEmail() { VerifyCodeSettings verifyCodeSettings = new VerifyCodeSettings.Builder() .Action(VerifyCodeSettings.ACTION_REGISTER_LOGIN) .Locale(Locale.GetDefault()) .SendInterval(30).Build(); EmailAuthProvider.RequestVerifyCode(EmailAddress.text, verifyCodeSettings) .AddOnSuccessListener(result => { verifyCodeEmail.SetActive(true); }) .AddOnFailureListener(error => { loggedInUser.text = error.WrappedExceptionMessage; }); }
private void SendVerificationCode() { VerifyCodeSettings settings = VerifyCodeSettings.NewBuilder() .Action(VerifyCodeSettings.ActionRegisterLogin) .SendInterval(30) .Locale(Locale.English) .Build(); if (type == Type.Email) { string email = edtAccount.Text.ToString().Trim(); try { EmailAuthProvider.RequestVerifyCode(email, settings); Log.Info(TAG, "RequestVerifyCode called successfully."); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Long).Show(); } } else { string countryCode = edtCountryCode.Text.ToString().Trim(); string phoneNumber = edtAccount.Text.ToString().Trim(); try { PhoneAuthProvider.RequestVerifyCode(countryCode, phoneNumber, settings); Log.Info(TAG, "RequestVerifyCode function called successfully."); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Long).Show(); } } }