diff --git a/NucleicRemote/NucleicRemote/PushRegistrar.swift b/NucleicRemote/NucleicRemote/PushRegistrar.swift index ceb5a73..0f0b7b5 100644 --- a/NucleicRemote/NucleicRemote/PushRegistrar.swift +++ b/NucleicRemote/NucleicRemote/PushRegistrar.swift @@ -55,10 +55,11 @@ final class PushAppDelegate: NSObject, UIApplicationDelegate { didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void ) { - guard userInfo["clear"] != nil else { completionHandler(.noData); return } - Task { @MainActor in - NotificationRouter.shared.withdrawApprovalAttention() - completionHandler(.noData) + if userInfo["clear"] != nil { + // Fire-and-forget on the main actor (NotificationRouter is @MainActor); the removal is a + // quick UNUserNotificationCenter call, so we can report .noData right away. + Task { @MainActor in NotificationRouter.shared.withdrawApprovalAttention() } } + completionHandler(.noData) } }