Adjust Push Notification Logic

Nucleic-Session: 0F065CD6-20FE-4941-ACF5-C57A4572A5A3
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 12:53:32 -07:00
co-authored by Nucleic
parent 7e61921a4a
commit 3dfd28b28d
@@ -45,4 +45,20 @@ final class PushAppDelegate: NSObject, UIApplicationDelegate {
) {
// Best-effort: no token → the phone still works on LAN, just no remote wake.
}
/// Silent pushes. The relay sends a content-free `clear` (content-available) to recall the
/// "waiting for your approval" tickle once the approval is resolved on another device — we
/// wake in the background just long enough to withdraw the stale notification. Other silent
/// pushes (e.g. the wake tickle itself, which is an alert) don't route here.
func application(
_ application: UIApplication,
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)
}
}
}