Ejemplo n.º 1
0
        async void FacebookCheck(string id, int social, string email, string picture)
        {
            var responsefirst = await ClientGuanajoven.verifyemail(email);

            var y = checkError(responsefirst);

            if (checkError(responsefirst) != "Correo no encontrado")
            {
                //Enter to the system
                ShowProgress("Validando");
                var response = await ClientGuanajoven.loginFacebook(email, id);

                // checkError(response);
                if (ValidateResponse(response, checkError(response)))
                {
                    var user     = JsonConvert.DeserializeObject <ResponseUsuario>(response);
                    var posicion = await ClientGuanajoven.getPosition(user.data.api_token);

                    user.data.posicion = ClientGuanajoven.Data(posicion);
                    PropertiesManager.SaveUserInfo(user);
                    ShowProgress(IProgressType.LogedIn);
                    await Task.Delay(600);

                    HideProgress();
                    await Navigation.PushModalAsync(new HomeDrawerPage());
                }
                HideProgress();
            }
            else
            {
                await Navigation.PushAsync(new SignUpPage(id, social, email, picture));
            }
        }