Пример #1
0
        private void PhoneNumberVerification(object sender, VerificationEventArgs e)
        {
            try {
                switch (e.Status)
                {
                case VerificationStatus.Success:
                    indicator.IsRunning = false;
                    indicator.IsVisible = false;
                    Navigation.PushAsync(new UserInfoPage());

                    var navigationList = Navigation.NavigationStack.ToList();
                    var smsPage        = navigationList.FirstOrDefault(x => x.GetType() == typeof(SmsVerificationPage));
                    Navigation.RemovePage(smsPage);
                    break;

                case VerificationStatus.Failed:
                    if (!string.IsNullOrEmpty(e.Message))
                    {
                        Application.Current.MainPage.DisplayAlert("Alert", e.Message, "OK");
                    }
                    else
                    {
                        Application.Current.MainPage.DisplayAlert("Alert", "Verification failed!", "OK");
                    }
                    break;
                }
            } catch (Exception ex) {
                Console.WriteLine(ex.Message);
            }
        }
Пример #2
0
 private void verificationComponent1_Verificationed(VerificationEventArgs e)
 {
     if (!e.IsVerifySuccess)
     {
         lstErrorControl.Add(e.VerificationControl);
     }
 }
Пример #3
0
        async void LoginVerification(object sender, VerificationEventArgs e)
        {
            try {
                switch (e.Status)
                {
                case VerificationStatus.Success:
                    await Navigation.PushAsync(new UserInfoPage());

                    break;

                case VerificationStatus.CodeSent:
                    indicator.IsRunning = false;
                    indicator.IsVisible = false;
                    await Navigation.PushAsync(new SmsVerificationPage(phoneEntry.Text));

                    break;

                case VerificationStatus.Failed:
                    if (!string.IsNullOrEmpty(e.Message))
                    {
                        await Application.Current.MainPage.DisplayAlert("Alert", e.Message, "OK");
                    }
                    else
                    {
                        await Application.Current.MainPage.DisplayAlert("Alert", "Login failed!", "OK");
                    }
                    break;
                }
            } catch (Exception ex) {
                Console.WriteLine(ex.Message);
            }
        }
Пример #4
0
        void ApplicationEvents_VerificationChanged(object sender, VerificationEventArgs e)
        {
            Text = CurrentApplication.Name + " - (" + CurrentApplication.CurrentVerification + ")";

            if (Environment.CommandLine.Contains(" /developer"))
            {
                Text += " - Debug";
            }
        }