From 5535152810d29468807e6a2530db88a4060a9af8 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Mon, 6 Jul 2026 21:34:20 -0700 Subject: [PATCH] Push Notification Live Activity Redundancy Nucleic-Session: 73687ED9-C11C-438C-832B-979332B73893 Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Models/RemoteStore.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index ff40b49..39b361d 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -698,8 +698,15 @@ final class RemoteStore: ObservableObject { !self.openApprovals.contains(where: { $0.id == req.id }) { self.openApprovals.append(req) } - // Post for any host; the router suppresses the banner if the user is on this session. - NotificationRouter.shared.postApproval(req, sessionTitle: title) + // Prefer the Live Activity: when backgrounded with a glance on screen, the glance itself + // carries the approval (its inline Allow/Deny) and alerts (sound/haptic) via the local + // update path — so don't also post a banner. In-app the glance isn't the surface (it + // doesn't show over the app that controls it), so the banner is; and if there's no glance + // at all (Live Activities off) the banner is the only surface, so keep it as the fallback. + // willPresent still suppresses the banner when the user is already on this session. + if isForeground || !LiveActivityManager.shared.hasLiveActivity { + NotificationRouter.shared.postApproval(req, sessionTitle: title) + } } cb.approvalResolved = { [weak self] resolved in guard let self else { return }