From ac01589dbf934e0a4af32d618eb63ab7ead20d73 Mon Sep 17 00:00:00 2001 From: Nucleic Date: Fri, 26 Jun 2026 15:07:54 -0700 Subject: [PATCH] Cloud Infrastructure Setup Nucleic-Session: 5AC77C62-A729-42E5-A368-1142C3B9E695 --- NucleicRemote/NucleicRemote/NucleicRemoteApp.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift b/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift index 450a3a3..7b055d8 100644 --- a/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift +++ b/NucleicRemote/NucleicRemote/NucleicRemoteApp.swift @@ -3,12 +3,21 @@ import SwiftUI @main struct NucleicRemoteApp: App { @StateObject private var store = RemoteStore() + @Environment(\.scenePhase) private var scenePhase var body: some Scene { WindowGroup { RootView() .environmentObject(store) - .onAppear { store.onAppear() } + .onAppear { + store.onAppear() + // Anonymous, opt-out, once-a-day DAU heartbeat (docs/CLOUD_INFRA.md ยง4). + Task { await HeartbeatReporter.reportIfDue() } + } + // Re-check on every foreground so a new active day is counted. + .onChange(of: scenePhase) { _, phase in + if phase == .active { Task { await HeartbeatReporter.reportIfDue() } } + } } } }