Adjust Push Notification Logic
Nucleic-Session: 0F065CD6-20FE-4941-ACF5-C57A4572A5A3 Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user