public async Task HandleNotificationActivationAsync(NotificationType type)
        {
            switch (type)
            {
            case NotificationType.CheckInAvailable:
                await _tripsService.SetCurrentFlightStatusAsync(FlightStatus.CheckInAvailable);

                await _navigationService.NavigateToAsync <MyTripsViewModel>();

                await _navigationService.RemoveLastFromBackStackAsync();

                break;

            case NotificationType.DelayedFlight:
                await _tripsService.SetCurrentFlightStatusAsync(FlightStatus.Delayed);

                await _navigationService.NavigateToAsync <MyTripsViewModel>();

                await _navigationService.RemoveLastFromBackStackAsync();

                break;

            case NotificationType.GiveFeedback:
                await _navigationService.NavigateToAsync <FeedbackViewModel>();

                break;
            }
        }
Example #2
0
        public async Task LogoutAsync()
        {
            Settings.RemoveAuth();
            App.AuthenticationClient.UserTokenCache.Clear(Settings.ClientId);
            await _tripsService.SetCurrentFlightStatusAsync(FlightStatus.CheckInAvailable);

            // MSAL uses native embedded browser for sign-in process, where
            // authentication cookies are persisted. To enable a full log in/out
            // behavior, we should clear all browser cookies before signing in again
            await _browserCookiesService.ClearCookiesAsync();
        }
Example #3
0
        private async void DoneAsync()
        {
            MessagingCenter.Send(Flights, MessengerKeys.CheckInDone);
            MessagingCenter.Send <ViewModelBase, NotificationType>(this, MessengerKeys.NotificationRequest, NotificationType.DelayedFlight);
            MessagingCenter.Send <ViewModelBase, NotificationType>(this, MessengerKeys.NotificationRequest, NotificationType.GiveFeedback);

            await _tripsService.SetCurrentFlightStatusAsync(FlightStatus.AlreadyChecked);

            await NavigationService.RemoveLastFromBackStackAsync();

            await NavigationService.NavigateBackAsync();
        }