1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-22 11:35:21 +01:00

move splash screen logic to OnResignActivation (#1674)

This commit is contained in:
Jake Fink 2021-12-07 09:45:05 -05:00 committed by GitHub
parent 05bcc10277
commit dddc38ef64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,17 +183,8 @@ namespace Bit.iOS
return base.FinishedLaunching(app, options); return base.FinishedLaunching(app, options);
} }
public override void DidEnterBackground(UIApplication uiApplication) public override void OnResignActivation(UIApplication uiApplication)
{ {
_storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
_messagingService.Send("slept");
if (UIApplication.SharedApplication.KeyWindow == null)
{
// Despite IDE warning, KeyWindow is null here during app termination in iOS 15
return;
}
var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame) var view = new UIView(UIApplication.SharedApplication.KeyWindow.Frame)
{ {
Tag = 4321 Tag = 4321
@ -213,6 +204,13 @@ namespace Bit.iOS
UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(view); UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(view);
UIApplication.SharedApplication.KeyWindow.EndEditing(true); UIApplication.SharedApplication.KeyWindow.EndEditing(true);
UIApplication.SharedApplication.SetStatusBarHidden(true, false); UIApplication.SharedApplication.SetStatusBarHidden(true, false);
base.OnResignActivation(uiApplication);
}
public override void DidEnterBackground(UIApplication uiApplication)
{
_storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
_messagingService.Send("slept");
base.DidEnterBackground(uiApplication); base.DidEnterBackground(uiApplication);
} }