diff --git a/src/App/Services/AuthService.cs b/src/App/Services/AuthService.cs index 988dbebc1..8094b0814 100644 --- a/src/App/Services/AuthService.cs +++ b/src/App/Services/AuthService.cs @@ -260,6 +260,7 @@ namespace Bit.App.Services _googleAnalyticsService.TrackAppEvent("LoggedOut"); + MessagingCenter.Send(Application.Current, "LoggedOut"); Device.BeginInvokeOnMainThread(() => Application.Current.MainPage = new ExtendedNavigationPage(new HomePage())); if(!string.IsNullOrWhiteSpace(logoutMessage)) { diff --git a/src/iOS/AppDelegate.cs b/src/iOS/AppDelegate.cs index 44607fe5a..c54509b54 100644 --- a/src/iOS/AppDelegate.cs +++ b/src/iOS/AppDelegate.cs @@ -112,52 +112,57 @@ namespace Bit.iOS modal.PresentViewController(activityViewController, true, null); }); - MessagingCenter.Subscribe(Xamarin.Forms.Application.Current, - "ListenYubiKeyOTP", (sender, listen) => + MessagingCenter.Subscribe( + Xamarin.Forms.Application.Current, "ListenYubiKeyOTP", (sender, listen) => + { + if(_deviceInfoService.NfcEnabled) { - if(_deviceInfoService.NfcEnabled) + _nfcSession?.InvalidateSession(); + _nfcSession?.Dispose(); + _nfcSession = null; + if(listen) { - _nfcSession?.InvalidateSession(); - _nfcSession?.Dispose(); - _nfcSession = null; - if(listen) - { - _nfcSession = new NFCNdefReaderSession(_nfcDelegate, null, true); - _nfcSession.AlertMessage = AppResources.HoldYubikeyNearTop; - _nfcSession.BeginSession(); - } + _nfcSession = new NFCNdefReaderSession(_nfcDelegate, null, true); + _nfcSession.AlertMessage = AppResources.HoldYubikeyNearTop; + _nfcSession.BeginSession(); } - }); + } + }); UIApplication.SharedApplication.StatusBarHidden = false; UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; - MessagingCenter.Subscribe(Xamarin.Forms.Application.Current, - "ShowStatusBar", (sender, show) => + MessagingCenter.Subscribe( + Xamarin.Forms.Application.Current, "ShowStatusBar", (sender, show) => { UIApplication.SharedApplication.SetStatusBarHidden(!show, false); }); - MessagingCenter.Subscribe(Xamarin.Forms.Application.Current, - "FullSyncCompleted", (sender, successfully) => + MessagingCenter.Subscribe( + Xamarin.Forms.Application.Current, "FullSyncCompleted", (sender, successfully) => { if(successfully) { - + } }); - MessagingCenter.Subscribe(Xamarin.Forms.Application.Current, - "UpsertedCipher", (sender, id) => + MessagingCenter.Subscribe( + Xamarin.Forms.Application.Current, "UpsertedCipher", (sender, id) => { - + }); - - MessagingCenter.Subscribe(Xamarin.Forms.Application.Current, - "DeletedCipher", (sender, id) => + MessagingCenter.Subscribe( + Xamarin.Forms.Application.Current, "DeletedCipher", (sender, id) => { - + + }); + + MessagingCenter.Subscribe( + Xamarin.Forms.Application.Current, "LoggedOut", (sender) => + { + }); ZXing.Net.Mobile.Forms.iOS.Platform.Init();