コード例 #1
0
        private async void Logout()
        {
            if (IsFacebook)
            {
                _facebookManager.Logout();
            }
            else
            {
                _googleManager.Logout();
            }

            await App.Current.MainPage.Navigation.PopAsync();
        }
コード例 #2
0
        private async void ConfirmLogout_Tapped(object sender, EventArgs e)
        {
            IsBusy = true;
            (BindingContext as HomePageViewModel).LogoutPopupIsVisible = false;
            _facebookManager.Logout();
            _googleManager.Logout();
            Application.Current.Properties["IsLogedIn"]     = false;
            Application.Current.Properties["LogedInUserId"] = 0;
            Application.Current.Properties["UserName"]      = string.Empty;
            await Application.Current.SavePropertiesAsync();

            await(BindingContext as HomePageViewModel)._nav.NavigateAsync("SignInPage");
            IsBusy = false;
        }
コード例 #3
0
 private void OnLoginComplete(GoogleUser googleUser, string message)
 {
     if (googleUser != null)
     {
         //TODO
         //if(GameController.getInstance().IsAdmin(googleUser.Email));
         //Application.Current.MainPage = new AdminPage(googleUser);
         ContentPage nextPage = new groupCreationPage(googleUser.ID, User.SOCIAL_NETWORK.Google);
         _googleManager.Logout();
         Application.Current.MainPage = nextPage;
     }
     else
     {
         Device.BeginInvokeOnMainThread(async() =>
         {
             await DisplayAlert(AppResources.error, AppResources.error_in_google_login, AppResources.ok);
         });
     }
 }
コード例 #4
0
        private void GoogleLogin()
        {
            try
            {
                _googleManager = DependencyService.Get <IGoogleManager>();

                UserDialogs.Instance.ShowLoading("Iniciando sesion...", MaskType.Black);

                _googleManager.Login(OnLoginComplete);

                #if __IOS__
                UserDialogs.Instance.HideLoading();
                #endif

                _googleManager.Logout();
            }
            catch (Exception)
            {
            }
        }
コード例 #5
0
 private void GoogleLogout()
 {
     _googleManager.Logout();
     IsLogedIn = false;
 }
コード例 #6
0
        private async void CierraSesion()
        {
            try
            {
                var result = await Application.Current.MainPage.DisplayAlert("City Center Rosario", "¿Está seguro que desea salir de la aplicación?", "OK", "Cancelar");

                string Mensajevalida = string.Format("Result {0}", result);

                if (Mensajevalida == "Result True")
                {
                    UserDialogs.Instance.ShowLoading("Cerrando sesión...", MaskType.Black);

                    Application.Current.Properties["IsLoggedIn"]      = false;
                    Application.Current.Properties["IdUsuario"]       = 0;
                    Application.Current.Properties["Email"]           = "";
                    Application.Current.Properties["NombreCompleto"]  = "";
                    Application.Current.Properties["Ciudad"]          = "";
                    Application.Current.Properties["Pass"]            = "";
                    Application.Current.Properties["FechaNacimiento"] = "";
                    Application.Current.Properties["FotoPerfil"]      = "";
                    Application.Current.Properties["TipoCuenta"]      = "";

                    await Application.Current.SavePropertiesAsync();

                    //MainViewModel.GetInstance().Master = new MasterViewModel();
                    MainViewModel.GetInstance().Inicio = new InicioViewModel();
                    MainViewModel.GetInstance().Detail = new DetailViewModel();
                    MainViewModel.GetInstance().Casino = new CasinoViewModel();

                    PerfilVisible   = false;
                    OpcionesVisible = true;

                    ((MasterPage)Application.Current.MainPage).IsPresented = false;

                    _googleManager = DependencyService.Get <IGoogleManager>();
                    _googleManager.Logout();



                    try
                    {
                        var Contenido = new FormUrlEncodedContent(new[]
                        {
                            new KeyValuePair <string, string>("neq_equipo", Application.Current.Properties["Token"].ToString()),
                            new KeyValuePair <string, string>("neq_id_usuario", "0"),
                            new KeyValuePair <string, string>("neq_dispositivo", CrossDeviceInfo.Current.Platform.ToString()),
                            new KeyValuePair <string, string>("neq_app_id", CrossDeviceInfo.Current.Id)
                        });


                        var response2 = await this.apiService.Get <GuardadoGenerico>("/notificaciones", "/guardar_equipo", Contenido);

                        if (!response2.IsSuccess)
                        {
                        }
                    }
                    catch (Exception ex)
                    {
                    }

                    MasterPage fpm = new MasterPage();
                    //fpm.Master = new DetailPage(); // You have to create a Master ContentPage()

                    //App.NavPage = new NavigationPage(new CustomTabPage()) { BarBackgroundColor = Color.FromHex("#23144B") };

                    //fpm.Detail = App.NavPage; // You have to create a Detail ContenPage()
                    Application.Current.MainPage   = fpm;
                    App.NavPage.BarBackgroundColor = Color.FromHex("#23144B");
                    // ActualizaBarra.Cambio(VariablesGlobales.VentanaActual);

                    UserDialogs.Instance.HideLoading();
                }
            }
            catch (Exception ex)
            {
                UserDialogs.Instance.HideLoading();

                //  await  Mensaje.Alerta("Ocurrio un error al cerrar sesion");

                //await Application.Current.MainPage.DisplayAlert(
                //          "Error",
                //           ex.ToString(),
                //          "Ok");
            }
        }
コード例 #7
0
 private async void CallLogout()
 {
     _googleManager.Logout();
     await _navigationService.NavigateAsync("MainPage");
 }