Make UserNotificationManager a singleton. Clean up some code.

This commit is contained in:
Brent Simmons committed 2025-11-03 20:50:02 -08:00
1 parent eb346b6941
commit f1bd7e2264
3 files changed
+40 -28

No files matched your search

+3 -4
View File
@@ -39,7 +39,6 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationC
private static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "Application")
var userNotificationManager: UserNotificationManager!
var extensionContainersFile: ExtensionContainersFile!
var extensionFeedAddRequestFile: ExtensionFeedAddRequestFile!
var widgetDataEncoder: WidgetDataEncoder!
@@ -107,7 +106,7 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationC
}
UNUserNotificationCenter.current().delegate = self
userNotificationManager = UserNotificationManager()
UserNotificationManager.shared.start()
extensionContainersFile = ExtensionContainersFile()
extensionFeedAddRequestFile = ExtensionFeedAddRequestFile()
@@ -213,9 +212,9 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationC
let userInfo = response.notification.request.content.userInfo
switch response.actionIdentifier {
case "MARK_AS_READ":
case UserNotificationManager.ActionIdentifier.markAsRead:
handleMarkAsRead(userInfo: userInfo)
case "MARK_AS_STARRED":
case UserNotificationManager.ActionIdentifier.markAsStarred:
handleMarkAsStarred(userInfo: userInfo)
default:
if let sceneDelegate = response.targetScene?.delegate as? SceneDelegate {