When the app is brought to the foreground from an external action (e.g., tapping on the widget, opening from a notification), a notification is posted (with a slight delay).

`MasterFeedViewController` and `SettingsViewController` are observers. `MasterFeedViewController` will dismiss any `SFSafariViewController`s that are presented, while `SettingsViewController` will dismiss itself.
This commit is contained in:
Stuart Breckenridge
2021-11-06 22:43:50 +08:00
parent 50a61d6a67
commit 0db88c5f92
4 changed files with 27 additions and 0 deletions

View File

@@ -210,6 +210,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
default:
if let sceneDelegate = response.targetScene?.delegate as? SceneDelegate {
sceneDelegate.handle(response)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
NotificationCenter.default.post(name: .DidLaunchFromExternalAction, object: nil)
})
}
}