public void RequestVerifyCodeWithPhoneNumber()
    {
        VerifyCodeSettings verifyCodeSettings = new VerifyCodeSettings.Builder()
                                                .Action(VerifyCodeSettings.ACTION_REGISTER_LOGIN)
                                                .Locale(Locale.GetDefault())
                                                .SendInterval(30).Build();

        PhoneAuthProvider.RequestVerifyCode(PhoneCountryCode.text, PhoneNumber.text, verifyCodeSettings)
        .AddOnSuccessListener(verifyCodeResult => {
            verifyCodePhone.SetActive(true);
        })
        .AddOnFailureListener(exception => {
            loggedInUser.text = exception.WrappedExceptionMessage;
        });
    }
示例#2
0
        private void Send_Click(object sender, EventArgs e)
        {
            VerifyCodeSettings settings = VerifyCodeSettings.NewBuilder()
                                          .Action(VerifyCodeSettings.ActionRegisterLogin)
                                          .SendInterval(30)
                                          .Locale(Locale.English)
                                          .Build();
            string code   = countryCode.Text.ToString().Trim();
            string number = phoneNumber.Text.ToString().Trim();

            try
            {
                PhoneAuthProvider.RequestVerifyCode(code, number, settings);
                Log.Info(TAG, "RequestVerifyCode function called successfully.");
                Toast.MakeText(this, "verifyCode send successfully", ToastLength.Long).Show();
            }
            catch (Exception ex)
            {
                Toast.MakeText(this, ex.Message, ToastLength.Long).Show();
            }
        }
示例#3
0
        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();
                }
            }
        }