Exemplo n.º 1
0
        public async Task Deslogar()
        {
            _tokensource = new CancellationTokenSource();

            Boolean answer;

            answer = await
                     this._messageService.ShowAlertChooseAsync(
                AppResources.ConfirmaSair
                , AppResources.cancelar
                , AppResources.Ok
                , null);

            if (answer == true)
            {
                await Task.Run(async() =>
                {
                    TokenDataStore store = new TokenDataStore();
                    store.Clean();

                    try
                    {
                        Bll_PushNotification classPushNotification = new Bll_PushNotification();
                        classPushNotification.DeletePushKey(_tokensource.Token);
                    }
                    catch (Exception ex)
                    {
                        Crashes.TrackError(ex);
                    }

                    try
                    {
                        ModelLogin modelUsuario = new ModelLogin();
                        modelUsuario.Deslogar(_tokensource.Token);
                    }
                    catch (Exception ex)
                    {
                        Crashes.TrackError(ex);
                    }
                });

                this._navigationService.NavigateToLogin();
            }
        }
Exemplo n.º 2
0
        public async Task Deslogar()
        {
            Boolean answer;

            answer = await
                     this._messageService.ShowAlertChooseAsync(
                AppResources.ConfirmaSair
                , AppResources.cancelar
                , AppResources.Ok
                , null);

            if (answer == true)
            {
                await Task.Run(async() =>
                {
                    TokenDataStore store = new TokenDataStore();
                    store.Clean();
                });

                this._navigationService.NavigateToLogin();
            }
        }