Example #1
0
        public async void GetLoginByEmail(string email, string password)
        {
            Dictionary <string, string> data = new Dictionary <string, string>();

            data.Add("apikey", this.apiKey);
            data.Add("email", email);
            data.Add("password", password);

            await LoginbyEmailAPI.GetLoginbyEmail(data, res => {
                Debug.Write("access_token", res.access_token);
            }, (error) => {
                Debug.Write("error", error.description);
            });
        }
Example #2
0
        public async void GetLoginbyEmail(string email, string password)
        {
            Dictionary <string, string> data = new Dictionary <string, string>();

            data.Add("apikey", apikey);
            data.Add("email", email);
            data.Add("password", password);

            await LoginbyEmailAPI.GetLoginbyEmail(data, response => {
                // Success event
                var activity2 = new Intent(this, typeof(ProfileActivity));
                activity2.PutExtra("access_token", Convert.ToString(response.access_token));
                StartActivity(activity2);
            }, (error) => {
                Toast.MakeText(this, error.description, ToastLength.Long).Show();                 // Failure event
            });
        }
Example #3
0
        async void OnLoginButtonClicked(object sender, EventArgs e)
        {
            Dictionary <string, string> data = new Dictionary <string, string>();

            data.Add("apikey", apikey);
            data.Add("email", emailEntry.Text);
            data.Add("password", passwordEntry.Text);

            await LoginbyEmailAPI.GetLoginbyEmail(data, response => {
                // Success event
                Preferences.Set("token", response.access_token);
                DisplayAlert("Alert", "hello" + response.Profile.FirstName, "OK");
                App.IsUserLoggedIn = true;
                Navigation.InsertPageBefore(new MainPage(), this);
                Navigation.PopAsync();
            }, (error) => {
                messageLabel.Text  = error.description;
                passwordEntry.Text = string.Empty;               // Failure event
            });
        }