async void HandleSaveUsernameButtonClicked(object sender, EventArgs e)
        {
            try
            {
                await SecureStorageService.SaveLogin(_usernameEntry.Text, _passwordEntry.Text);

                await Navigation.PopModalAsync();
            }
            catch (Exception ex)
            {
                await DisplayAlert("Error", ex.Message, "Okay");
            }
        }
Esempio n. 2
0
        protected override async Task Login(string username, string password)
        {
            var isLoginValid = await SecureStorageService.IsLoginCorrect(username, password).ConfigureAwait(false);

            if (isLoginValid)
            {
                Device.BeginInvokeOnMainThread(async() => await Navigation.PopAsync());
            }
            else
            {
                var isSignupSelected = await DisplayAlert("Invalid Login", "Sorry, we didn't recoginize the username or password. Feel free to sign up for free if you haven't!", "Sign up", "Try again");

                if (isSignupSelected)
                {
                    Device.BeginInvokeOnMainThread(async() => await Navigation.PushModalAsync(new NewUserSignUpPage()));

                    AppCenterHelpers.TrackEvent("NewUserSignUp", new Dictionary <string, string> {
                        { "ActionPoint", "System Prompt" },
                    });
                }
            }
        }