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
1 changed files with 8 additions and 10 deletions

View File

@ -183,17 +183,8 @@ namespace Bit.iOS
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)
{
Tag = 4321
@ -213,6 +204,13 @@ namespace Bit.iOS
UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(view);
UIApplication.SharedApplication.KeyWindow.EndEditing(true);
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);
}