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],
|
didReceiveRemoteNotification userInfo: [AnyHashable: Any],
|
||||||
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
|
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
|
||||||
) {
|
) {
|
||||||
guard userInfo["clear"] != nil else { completionHandler(.noData); return }
|
if userInfo["clear"] != nil {
|
||||||
Task { @MainActor in
|
// Fire-and-forget on the main actor (NotificationRouter is @MainActor); the removal is a
|
||||||
NotificationRouter.shared.withdrawApprovalAttention()
|
// quick UNUserNotificationCenter call, so we can report .noData right away.
|
||||||
|
Task { @MainActor in NotificationRouter.shared.withdrawApprovalAttention() }
|
||||||
|
}
|
||||||
completionHandler(.noData)
|
completionHandler(.noData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user