Live Activity Launch Consistency

Nucleic-Session: 9D2EE9AB-2E44-485B-A196-54D250F9D89B
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 20:05:39 -07:00
co-authored by Nucleic
parent 613fc404cf
commit f13a94c7b0
@@ -383,6 +383,10 @@ final class RemoteStore: ObservableObject {
/// suspends us and the socket dies, which the next `onForeground` revalidation reconnects fast. /// suspends us and the socket dies, which the next `onForeground` revalidation reconnects fast.
func onBackground() { func onBackground() {
guard !demoMode else { return } guard !demoMode else { return }
// Heading to the background: the app can't reliably start a Live Activity anymore, so tell the
// hosts to push-to-start the glance themselves when work begins (UX_IOS §5.3). Sent now while
// the socket-hold below still keeps the connection live for a beat.
setForegroundState(false)
#if canImport(UIKit) #if canImport(UIKit)
endBackgroundHold() endBackgroundHold()
backgroundTask = UIApplication.shared.beginBackgroundTask(withName: "nucleic.sync.hold") { backgroundTask = UIApplication.shared.beginBackgroundTask(withName: "nucleic.sync.hold") {