Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(ios): count setup steps, pairing, screens and notification answers
leepokai8284245a22bc
diff --git a/apps/ios/App/AccountSession.swift b/apps/ios/App/AccountSession.swiftindex d4abf648..c27f4e81 100644--- a/apps/ios/App/AccountSession.swift+++ b/apps/ios/App/AccountSession.swift@@ -100,6 +100,8 @@ final class AccountSession {errorMessage = "Sign-in setup isn't finished yet. You can continue using local pairing."return}+ let tracked: AnalyticsEvent.SignInProvider = provider == .apple ? .apple : .google+ Analytics.shared.capture(.signInStarted(tracked))isBusy = trueerrorMessage = nildefer { isBusy = false }@@ -122,15 +124,21 @@ final class AccountSession {errorMessage = "\(provider.rawValue) sign-up needs additional account information. Your account is not signed in yet."}}- if errorMessage == nil { Analytics.shared.capture(.signedIn) }- } catch let error as ASWebAuthenticationSessionError where error.code == .canceledLogin {- return- } catch let error as ASAuthorizationError where error.code == .canceled {- return- } catch is CancellationError {- return+ Analytics.shared.capture(errorMessage == nil ? .signedIn(tracked) : .signInFailed(tracked, reason: .verification))+ } catch where Self.isCancellation(error) {+ Analytics.shared.capture(.signInFailed(tracked, reason: .cancelled))} catch {errorMessage = "Couldn't sign in. Check your connection and try again."+ Analytics.shared.capture(.signInFailed(tracked, reason: .error))+ }+ }++ /// The user closed the sign-in sheet.+ private static func isCancellation(_ error: any Error) -> Bool {+ switch error {+ case let error as ASWebAuthenticationSessionError: error.code == .canceledLogin+ case let error as ASAuthorizationError: error.code == .canceled+ default: error is CancellationError}}diff --git a/apps/ios/App/CodyncApp.swift b/apps/ios/App/CodyncApp.swiftindex 4c4a5a30..e92476dc 100644--- a/apps/ios/App/CodyncApp.swift+++ b/apps/ios/App/CodyncApp.swift@@ -28,7 +28,10 @@ struct CodyncApp: App {.environment(app.accounts).environment(app.account)// A computer needs a newer app: its App Store page has the Update button.- .environment(\.appUpdate, AppUpdateAction { UIApplication.shared.open(AppStoreRelease.page) })+ .environment(\.appUpdate, AppUpdateAction {+ Analytics.shared.capture(.linkOpened(.appStore))+ UIApplication.shared.open(AppStoreRelease.page)+ }).environment(updates).tint(Palette.accent)// No scroll indicators anywhere in the app.@@ -55,11 +58,10 @@ struct CodyncApp: App {}}.onOpenURL { url in app.open(url) }- .onChange(of: onboardingCompleted) { _, done in if done { Analytics.shared.capture(.onboardingCompleted) } }.onChange(of: scenePhase, initial: true) { _, phase inswitch phase {case .active: Analytics.shared.becameActive()- case .background: Analytics.shared.enteredBackground()+ case .background: BackgroundTime.run("Analytics") { await Analytics.shared.enteredBackground() }default: break}// Only leaving for the background disconnects; `.inactive` (Control Center,@@ -75,7 +77,7 @@ struct CodyncApp: App {.task {// Simulator/UI-test pairing: SIMCTL_CHILD_CODYNC_PAIR_URL=codync://pair?...if let s = ProcessInfo.processInfo.environment["CODYNC_PAIR_URL"], let p = Pairing(string: s) {- _ = try? await app.pair(p)+ _ = try? await app.pair(p, via: .link)}if ProcessInfo.processInfo.environment["CODYNC_OPEN_USAGE"] != nil { app.tab = .state; app.showUsage = true }if ProcessInfo.processInfo.environment["CODYNC_STATE_SURFACE"] != nil { app.tab = .state }@@ -123,6 +125,12 @@ final class AppStore {SharedStore.activeAccountID = session.userIDaccount = sessionAnalytics.shared.userID = { [session] in session.userID }+ Analytics.shared.foregroundState = {+ let allowed = await PushRegistrar.shared.isAllowed()+ // Unreadable (WidgetKit's error carries nothing to act on): `app_opened` leaves the count out.+ let widgets = try? await WidgetCenter.shared.currentConfigurations().count+ return (allowed.map { $0 ? .allowed : .denied } ?? .notAsked, widgets)+ }CrashReports.shared.start()contextID = storage.id(accounts, cloud) = Self.makeAccounts(storage, session: session)@@ -189,10 +197,26 @@ final class AppStore {WidgetCenter.shared.reloadAllTimelines()}- func pair(_ pairing: Pairing) async throws -> Computer {- let computer = try await accounts.pair(pairing, deviceName: UIDevice.current.name, platform: "ios")- Analytics.shared.capture(.computerPaired, ["via": "qr", "computer": Analytics.computerTag(computer.id)])- return computer+ /// A scanned, pasted or opened pairing link; one that can't be read is recorded before it's shown.+ func pairing(from link: String) throws -> Pairing {+ do { return try Pairing.parse(link) } catch { throw pairingFailed(error) }+ }++ /// `via`: `qr` scanned or pasted here, `link` opened from the Camera app.+ func pair(_ pairing: Pairing, via: AnalyticsEvent.PairVia) async throws -> Computer {+ do {+ let computer = try await accounts.pair(pairing, deviceName: UIDevice.current.name, platform: "ios")+ Analytics.shared.capture(.computerPaired(via: via, computer: computer.id))+ return computer+ } catch {+ throw pairingFailed(error)+ }+ }++ /// Records why pairing failed (nothing when it was called off) and hands the error on.+ private func pairingFailed(_ error: any Error) -> any Error {+ if let reason = AnalyticsEvent.PairingFailure(error) { Analytics.shared.capture(.pairingFailed(reason)) }+ return error}func open(_ url: URL) {@@ -206,7 +230,7 @@ final class AppStore {// Scanned with the Camera app: pair right away.let accounts = accountsTask {- do { _ = try await pair(try Pairing.parse(url)) } catch { accounts.lastError = error.localizedDescription }+ do { _ = try await pair(try pairing(from: url.absoluteString), via: .link) } catch { accounts.lastError = error.localizedDescription }}case "bot":guard let ref = storage.reference(from: url), accounts.store(for: ref.computerId) != nil else { return }@@ -318,10 +342,12 @@ final class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCentlet ctx = info["ctx"] as? Stringlet computerId = info["computerId"] as? Stringlet botId = info["botId"] as? String+ let kind = AnalyticsEvent.NotificationKind(category: response.notification.request.content.categoryIdentifier)// UIKit saves application state from this completion. The async delegate// bridge can complete off the main thread even after MainActor.run.Task { @MainActor indefer { completionHandler() }+ if let kind { Analytics.shared.capture(.notificationOpened(kind)) }guard let ctx, let computerId, let botId else { return }// Only open it in the account it was sent to, on a computer that account still has.let accounts = AppStore.shared.accounts@@ -337,6 +363,27 @@ final class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCent}}+/// Background time for work that has to finish after the app leaves the screen (the analytics+/// batch); without it iOS suspends the app with the work half done.+@MainActor+private final class BackgroundTime {+ private var id = UIBackgroundTaskIdentifier.invalid++ static func run(_ name: String, _ work: @escaping @MainActor @Sendable () async -> Void) {+ let time = BackgroundTime()+ let task = Task { await work() }+ // Out of time: give the work up rather than have iOS end the app for overrunning.+ time.id = UIApplication.shared.beginBackgroundTask(withName: name) { task.cancel(); time.end() }+ Task { await task.value; time.end() }+ }++ private func end() {+ guard id != .invalid else { return }+ UIApplication.shared.endBackgroundTask(id)+ id = .invalid+ }+}+/// Keeps the Bots widget's snapshot current; asks WidgetKit to redraw only when/// something the widget shows changes (who is working / needs you / unread).@MainActordiff --git a/apps/ios/App/Push.swift b/apps/ios/App/Push.swiftindex 4bafa195..4eaebe1c 100644--- a/apps/ios/App/Push.swift+++ b/apps/ios/App/Push.swift@@ -92,8 +92,16 @@ final class PushRegistrar {}}- func requestAuthorization() async -> Bool {- let granted = (try? await UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge])) ?? false+ /// Shows the system prompt; `source` is the button that asked (the app never asks on its own).+ func requestAuthorization(from source: AnalyticsEvent.PromptSource) async -> Bool {+ let granted: Bool+ do {+ granted = try await UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge])+ } catch {+ log.error("notification authorization failed: \(error.localizedDescription)")+ return false+ }+ Analytics.shared.capture(.notificationsAnswered(granted: granted, source: source))if granted { UIApplication.shared.registerForRemoteNotifications() }return granted}diff --git a/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift b/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swiftindex cc72f63a..71afc601 100644--- a/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Analytics/Analytics.swift@@ -1,16 +1,6 @@import CryptoKitimport Foundation-/// What the iPhone reports. Bot and message events come from the computer's host instead.-public enum AnalyticsEvent: String, Sendable {- case appOpened = "app_opened"- case onboardingCompleted = "onboarding_completed"- case computerPaired = "computer_paired"- case signedIn = "signed_in"- case signedOut = "signed_out"- case voiceCallStarted = "voice_call_started"-}-/// Product analytics: batches events to PostHog, on unless turned off in Settings./// Only the app calls it; widgets and the notification extension never do.@MainActor@@ -59,11 +49,14 @@ public final class Analytics {/// The signed-in Codync account, read at capture time; nil = anonymous install ID.public var userID: @MainActor () -> String? = { nil }+ /// What `app_opened` says about this iPhone, read on each trip to the foreground; nil = unknown.+ public var foregroundState: @MainActor () async -> (notifications: AnalyticsEvent.Notifications?, widgets: Int?) = { (nil, nil) }private let defaults: UserDefaultsprivate let upload: @Sendable (Data) async -> Boolprivate(set) var pending: [Event] = []private var timer: Task<Void, Never>?- private var sending = false+ /// The batch on its way.+ private var sending: Task<Void, Never>?private var foreground = falseprivate var session = AnalyticsSession()/// The session the last launch ended in: where a crash MetricKit reports now happened.@@ -80,15 +73,17 @@ public final class Analytics {/// Turning it off drops everything not yet sent.public func setEnabled(_ enabled: Bool) {defaults.set(enabled, forKey: Self.enabledKey)- guard !enabled else { return flush() }+ guard !enabled else {+ flush()+ return+ }pending = []timer?.cancel()timer = nil}- /// `properties` are public names, never content.- public func capture(_ event: AnalyticsEvent, _ properties: [String: String] = [:]) {- record(event.rawValue, properties.mapValues(Value.string))+ public func capture(_ event: AnalyticsEvent) {+ record(event.name, event.properties)}func record(_ name: String, _ extra: [String: Value]) {@@ -119,7 +114,7 @@ public final class Analytics {/// A computer's analytics key, the same hash its host sends: joins `computer_paired` with that/// computer's events without revealing the id the relay knows it by.- public static func computerTag(_ id: ComputerID) -> String {+ nonisolated public static func computerTag(_ id: ComputerID) -> String {SHA256.hash(data: Data("codync-analytics:\(id)".utf8)).prefix(8).map { String(format: "%02x", $0) }.joined()}@@ -127,27 +122,35 @@ public final class Analytics {public func becameActive() {guard !foreground else { return }foreground = true- capture(.appOpened)+ Task {+ let state = await foregroundState()+ capture(.appOpened(notifications: state.notifications, widgets: state.widgets))+ }}- public func enteredBackground() {+ /// Sends everything queued and returns once it's sent or failed; the app holds background time for it.+ public func enteredBackground() async {foreground = false- flush()+ await sending?.value+ await flush()?.value}- func flush() {+ /// The upload it started; nil when nothing needs to (or can) go now.+ @discardableResult+ func flush() -> Task<Void, Never>? {timer?.cancel()timer = nil- guard !sending, !pending.isEmpty, isEnabled,- let body = try? JSONEncoder().encode(Batch(api_key: Self.apiKey, batch: pending)) else { return }+ guard sending == nil, !pending.isEmpty, isEnabled,+ let body = try? JSONEncoder().encode(Batch(api_key: Self.apiKey, batch: pending)) else { return nil }let sent = Set(pending.map(\.uuid))- sending = true- Task {+ let task = Task {let ok = await upload(body)- sending = false+ sending = nilif ok { pending.removeAll { sent.contains($0.uuid) } }if !pending.isEmpty { scheduleFlush() }}+ sending = task+ return task}private var installID: String {diff --git a/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift b/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swiftnew file mode 100644index 00000000..9a3be31b--- /dev/null+++ b/apps/ios/Kit/Sources/CodyncKit/Analytics/AnalyticsEvent.swift@@ -0,0 +1,133 @@+import Foundation++/// What the iPhone reports, each with its properties (docs/reference/analytics-events.md). Bot and+/// message events come from the computer's host instead. Every value is a count, a boolean or a+/// name from these enums: nothing typed by the user can get in.+public enum AnalyticsEvent: Equatable, Sendable {+ /// nil = couldn't be read; left out.+ case appOpened(notifications: Notifications? = nil, widgets: Int? = nil)+ case onboardingStepViewed(OnboardingStep)+ case onboardingCompleted(via: OnboardingVia)+ case signInStarted(SignInProvider)+ case signInFailed(SignInProvider, reason: SignInFailure)+ case signedIn(SignInProvider)+ case signedOut+ case pairingFailed(PairingFailure)+ case computerPaired(via: PairVia, computer: ComputerID)+ case accessRequested+ case accessRequestFailed(AccessFailure)+ case notificationsAnswered(granted: Bool, source: PromptSource)+ case notificationOpened(NotificationKind)+ case settingChanged(Setting, on: Bool)+ case linkOpened(Link)+ case voiceCallStarted(VoiceEngine)+ case screenViewed(Screen)++ public enum Notifications: String, Sendable { case allowed, denied, notAsked = "not_asked" }+ public enum OnboardingStep: String, Sendable { case welcome, install, scan }+ public enum OnboardingVia: String, Sendable { case paired, account, skipped }+ public enum SignInProvider: String, Sendable { case apple, google }+ public enum SignInFailure: String, Sendable { case cancelled, verification, error }+ public enum PairVia: String, Sendable { case qr, link, account }+ public enum AccessFailure: String, Sendable { case denied, expired, cancelled }+ public enum PromptSource: String, Sendable { case settings, widgets }+ public enum Setting: String, Sendable { case push, liveActivities = "live_activities" }+ public enum Link: String, Sendable {+ case github, appStore = "app_store", demo, tailscale, privacy, installCommand = "install_command"+ }+ public enum VoiceEngine: String, Sendable { case onDevice = "on_device", openai, gemini, cloud }+ public enum Screen: String, Sendable {+ case bots, state, chat, thread, trace, botDetails = "bot_details", memory, routines, marketplace+ case settings, computers, usage, account, pairing, voiceSettings = "voice_settings", remoteScreen = "remote_screen"+ }++ public enum NotificationKind: String, Sendable {+ case done, needsInput = "needs_input", failed++ /// The alert's APNs category (the host's alert kind); nil for anything else.+ public init?(category: String) {+ switch category {+ case "done": self = .done+ case "needsInput": self = .needsInput+ case "failed": self = .failed+ default: return nil+ }+ }+ }++ public enum PairingFailure: String, Sendable {+ case notPairingLink = "not_pairing_link", outdatedHost = "outdated_host", invalid+ case expired, unauthorized, unreachable, timeout, upgradeRequired = "upgrade_required", other++ /// nil when pairing was called off rather than failed (the account changed meanwhile).+ public init?(_ error: any Error) {+ switch error {+ case let problem as Pairing.Problem:+ self = switch problem {+ case .notPairingLink: .notPairingLink+ case .outdatedHost: .outdatedHost+ case .invalid: .invalid+ }+ case let host as HostError:+ self = switch host {+ case .upgradeRequired: .upgradeRequired+ // The host turns down a pairing code that expired or was already used.+ case .http(403, _): .expired+ case .unauthorized, .http(401, _): .unauthorized+ case .unreachable, .computerOffline: .unreachable+ case .http: .other+ }+ case let url as URLError where url.code == .timedOut: self = .timeout+ case is CancellationError: return nil+ default: self = .other+ }+ }+ }++ var name: String {+ switch self {+ case .appOpened: "app_opened"+ case .onboardingStepViewed: "onboarding_step_viewed"+ case .onboardingCompleted: "onboarding_completed"+ case .signInStarted: "sign_in_started"+ case .signInFailed: "sign_in_failed"+ case .signedIn: "signed_in"+ case .signedOut: "signed_out"+ case .pairingFailed: "pairing_failed"+ case .computerPaired: "computer_paired"+ case .accessRequested: "access_requested"+ case .accessRequestFailed: "access_request_failed"+ case .notificationsAnswered: "notifications_answered"+ case .notificationOpened: "notification_opened"+ case .settingChanged: "setting_changed"+ case .linkOpened: "link_opened"+ case .voiceCallStarted: "voice_call_started"+ case .screenViewed: "screen_viewed"+ }+ }++ var properties: [String: Analytics.Value] {+ switch self {+ case let .appOpened(notifications, widgets):+ var p: [String: Analytics.Value] = [:]+ p["notifications"] = notifications.map { .string($0.rawValue) }+ p["widgets"] = widgets.map(Analytics.Value.int)+ return p+ case let .onboardingStepViewed(step): return ["step": .string(step.rawValue)]+ case let .onboardingCompleted(via): return ["via": .string(via.rawValue)]+ case let .signInStarted(provider), let .signedIn(provider): return ["provider": .string(provider.rawValue)]+ case let .signInFailed(provider, reason): return ["provider": .string(provider.rawValue), "reason": .string(reason.rawValue)]+ case .signedOut, .accessRequested: return [:]+ case let .pairingFailed(reason): return ["reason": .string(reason.rawValue)]+ case let .computerPaired(via, computer):+ return ["via": .string(via.rawValue), "computer": .string(Analytics.computerTag(computer))]+ case let .accessRequestFailed(reason): return ["reason": .string(reason.rawValue)]+ case let .notificationsAnswered(granted, source): return ["granted": .bool(granted), "source": .string(source.rawValue)]+ case let .notificationOpened(kind): return ["kind": .string(kind.rawValue)]+ case let .settingChanged(setting, on): return ["setting": .string(setting.rawValue), "on": .bool(on)]+ case let .linkOpened(link): return ["link": .string(link.rawValue)]+ case let .voiceCallStarted(engine): return ["engine": .string(engine.rawValue)]+ case let .screenViewed(screen): return ["screen": .string(screen.rawValue)]+ }+ }+}diff --git a/apps/ios/Kit/Sources/CodyncUI/AnalyticsSheet.swift b/apps/ios/Kit/Sources/CodyncUI/AnalyticsSheet.swiftindex 01c0a109..3533fc1b 100644--- a/apps/ios/Kit/Sources/CodyncUI/AnalyticsSheet.swift+++ b/apps/ios/Kit/Sources/CodyncUI/AnalyticsSheet.swift@@ -5,7 +5,7 @@ import SwiftUI/// desktop app's and the terminal UI's, true to the privacy policy.public struct AnalyticsSheet: View {private static let details: [(icon: String, title: String, detail: String)] = [- ("chart.bar", "Features you use", "Opening the app, creating or deleting a bot, sending a message (how many attachments, never the files), running a routine or a voice call, installing a connector. Each comes with the app version, the platform, and the bot's agent and model."),+ ("chart.bar", "Features you use", "Opening the app and its screens, setting up and pairing (and whether you allow notifications), creating or deleting a bot, sending a message (how many attachments, never the files), running a routine or a voice call, installing a connector. Each comes with the app version, the platform, and the bot's agent and model."),("exclamationmark.triangle", "Crashes and errors", "When Codync crashes or an agent fails to answer: the kind of error and where in Codync's own code it happened. Never the error's message; file paths are cut down to Codync's own files."),("globe", "Approximate location", "Country and city, looked up from your IP address. The IP address itself is never stored."),("person.crop.circle", "Who it belongs to", "Your Codync account when you're signed in, otherwise a random ID made on this device."),@@ -51,6 +51,7 @@ public struct AnalyticsSheet: View {.foregroundStyle(Palette.secondary).tint(Palette.text).padding(.horizontal, 2)+ .trackedLinks(.privacy)}}.background(Palette.background)diff --git a/apps/ios/Kit/Sources/CodyncUI/AnalyticsTracking.swift b/apps/ios/Kit/Sources/CodyncUI/AnalyticsTracking.swiftnew file mode 100644index 00000000..ee290ed6--- /dev/null+++ b/apps/ios/Kit/Sources/CodyncUI/AnalyticsTracking.swift@@ -0,0 +1,20 @@+import CodyncKit+import SwiftUI++extension View {+ /// Records `event` each time this view appears, and again whenever it changes while shown+ /// (a tab or a step); nil records nothing.+ public func tracked(_ event: AnalyticsEvent?) -> some View {+ onAppear { if let event { Analytics.shared.capture(event) } }+ .onChange(of: event) { _, event in if let event { Analytics.shared.capture(event) } }+ }++ /// Records `link_opened` for a link opened inside this view (`Link`, a link in `Text`); the+ /// system still opens it.+ public func trackedLinks(_ link: AnalyticsEvent.Link) -> some View {+ environment(\.openURL, OpenURLAction { _ in+ Analytics.shared.capture(.linkOpened(link))+ return .systemAction+ })+ }+}diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swiftindex 46b3ae13..57717ce6 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/BotDetailsView.swift@@ -51,6 +51,7 @@ struct BotDetailsView: View {.scrollDismissesKeyboard(.interactively).background(Palette.background).overlay(alignment: .topTrailing) { actions }+ .tracked(.screenViewed(.botDetails)).task(id: botId) { draft = bot.map(BotDraft.init) }.onChange(of: draft) { _, draft in autosave(draft) }.codyncSheet(item: $template) { BotTemplateView(draft: $0.draft) }diff --git a/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swift b/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swiftindex 8b0f3876..9cdbe283 100644--- a/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Bots/MemoryView.swift@@ -33,6 +33,7 @@ struct MemoryCard: View {else { Text("Loading memory…").foregroundStyle(Palette.secondary) }}}+ .tracked(.screenViewed(.memory))// Memory changes anywhere move the bot's `memoryRev`: fetch again..task(id: "\(botId)-\(bot?.memoryRev ?? 0)-\(bot?.sharedMemory ?? false)-\(bot?.harnessMemory ?? false)") {let store = memory ?? MemoryStore(botId: botId) { try await host.ready() }diff --git a/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift b/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swiftindex 0ae5525f..38402943 100644--- a/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Call/CallView.swift@@ -20,6 +20,8 @@ struct CallView: View {/// One line under the bar, e.g. why the call fell back to on-device voice.@State private var notice: String?@State private var settings = false+ /// `voice_call_started` went out for this call.+ @State private var reported = falseprivate var bot: Bot? { model.bots[botId] }private var color: Color { bot.map { AvatarPalette.color($0.avatarColor) } ?? Palette.accent }@@ -38,7 +40,6 @@ struct CallView: View {.animation(Motion.reduced(Motion.fade, reduceMotion), value: notice).onAppear {startedAt = .now- Analytics.shared.capture(.voiceCallStarted)begin(cloud: VoiceSettings.provider)}.onDisappear {@@ -52,6 +53,11 @@ struct CallView: View {.onChange(of: session?.phase) { _, phase inisSpeaking = phase == .speakinginterrupt = phase == .speaking ? { session?.interrupt() } : nil+ // Counted once audio flows, so it names the engine the call ended up on.+ if phase?.isActive == true, !reported, let session {+ reported = true+ Analytics.shared.capture(.voiceCallStarted(session.analyticsName))+ }// A cloud engine that can't start or drops mid-call hands over to on-device voice.if case .failed(let message) = phase, let provider = session?.provider {countCloudMinutes()diff --git a/apps/ios/Kit/Sources/CodyncUI/Call/VoiceChatSettingsView.swift b/apps/ios/Kit/Sources/CodyncUI/Call/VoiceChatSettingsView.swiftindex d81f2ca7..45a6fdac 100644--- a/apps/ios/Kit/Sources/CodyncUI/Call/VoiceChatSettingsView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Call/VoiceChatSettingsView.swift@@ -43,6 +43,7 @@ public struct VoiceChatSettingsView: View {}}.background(Palette.background)+ .tracked(.screenViewed(.voiceSettings))}private var engineFooter: String {diff --git a/apps/ios/Kit/Sources/CodyncUI/Call/VoiceEngine.swift b/apps/ios/Kit/Sources/CodyncUI/Call/VoiceEngine.swiftindex 9d409a84..112e5951 100644--- a/apps/ios/Kit/Sources/CodyncUI/Call/VoiceEngine.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Call/VoiceEngine.swift@@ -34,6 +34,18 @@ protocol VoiceEngine: AnyObject, Observable {func announce(_ notice: String)}+extension VoiceEngine {+ /// The engine's name in analytics.+ var analyticsName: AnalyticsEvent.VoiceEngine {+ if self is CloudSpeechEngine { return .cloud }+ return switch provider {+ case .openAI: .openai+ case .gemini: .gemini+ case nil: .onDevice+ }+ }+}+struct VoiceError: LocalizedError {let message: Stringinit(_ message: String) { self.message = message }diff --git a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swiftindex d18fde70..e0d536c3 100644--- a/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Marketplace/MarketplaceView.swift@@ -65,6 +65,7 @@ public struct MarketplaceView: View {}}.background(Palette.background)+ .tracked(.screenViewed(.marketplace)).task {await model.refreshPlugins()}diff --git a/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift b/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swiftindex 1b0e9c64..f80b9a77 100644--- a/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Routines/RoutinesView.swift@@ -59,6 +59,8 @@ struct RoutinesView: View {}Task { await load() }}+ // The list is part of bot details; a routine's editor is the routines screen, as on the desktop.+ .tracked(.screenViewed(.routines))}}diff --git a/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenView.swift b/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenView.swiftindex e2cf4020..597c92f2 100644--- a/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenView.swift@@ -58,6 +58,7 @@ public struct ScreenView: View {.statusBarHidden().persistentSystemOverlays(.hidden).preferredColorScheme(.dark)+ .tracked(.screenViewed(.remoteScreen)).onAppear {OrientationLock.viewerAppeared()start()diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swiftindex 99b32dce..124afbe6 100644--- a/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Store/AccountStore.swift@@ -162,6 +162,7 @@ public final class AccountStore {}let ticket = try await cloud.requestAccess(id, signKey: target.signKey)guard !retired else { throw CancellationError() }+ Analytics.shared.capture(.accessRequested)setPending(id, ticket)accessPolls[id]?.cancel()accessPolls[id] = Task { [weak self] in await self?.awaitApproval(ticket, target: target, cloud: cloud) }@@ -239,6 +240,7 @@ public final class AccountStore {guard let ticket = pendingAccess[id] else { return }accessPolls.removeValue(forKey: id)?.cancel()setPending(id, nil)+ Analytics.shared.capture(.accessRequestFailed(.cancelled))do {try await cloud?.cancelAccess(ticket.requestId)} catch {@@ -262,11 +264,17 @@ public final class AccountStore {cloud: cloud.baseURL, device: target.device)save(computer)open(computer)- Analytics.shared.capture(.computerPaired, ["via": "account", "computer": Analytics.computerTag(computer.id)])+ Analytics.shared.capture(.computerPaired(via: .account, computer: computer.id))await refreshCloud()returncase .denied, .expired, .cancelled:setPending(ticket.computerId, nil)+ let reason: AnalyticsEvent.AccessFailure = switch status.status {+ case .denied: .denied+ case .expired: .expired+ default: .cancelled+ }+ Analytics.shared.capture(.accessRequestFailed(reason))lastError = status.status == .denied ? "\(target.name) declined the request." : "The request expired. Ask again."return}diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/RepliesView.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/RepliesView.swiftindex 5989a760..07955505 100644--- a/apps/ios/Kit/Sources/CodyncUI/Thread/RepliesView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/RepliesView.swift@@ -45,6 +45,7 @@ struct RepliesView: View {}}.background(Palette.background)+ .tracked(.screenViewed(.thread)).task(id: rootId) { await model.loadThread(botId, root: rootId) }// A thread is read on its own: having it open reads its replies..readingConversation(botId, thread: rootId)diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swiftindex 59b17569..2137c954 100644--- a/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/ThreadView.swift@@ -324,6 +324,7 @@ struct IntroCard: View {extension ThreadView {public var body: some View {conversation+ .tracked(.screenViewed(.chat)).codyncSheet(item: $openThread) { target inRepliesView(botId: botId, rootId: target.id) { closeThread() }}diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/TraceView.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/TraceView.swiftindex dc71717e..d8f2275c 100644--- a/apps/ios/Kit/Sources/CodyncUI/Thread/TraceView.swift+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/TraceView.swift@@ -44,6 +44,7 @@ public struct TraceView: View {.defaultScrollAnchor(.bottom)}.background(Palette.background)+ .tracked(.screenViewed(.trace))}}diff --git a/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swiftindex 5d17c7ec..a3df693b 100644--- a/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift+++ b/apps/ios/Kit/Tests/CodyncKitTests/AnalyticsTests.swift@@ -9,18 +9,19 @@ import Testing// On until turned off; off drops what's queued and records nothing more.#expect(analytics.isEnabled)- analytics.capture(.appOpened)+ analytics.capture(.appOpened())#expect(analytics.pending.map(\.event) == ["app_opened"])analytics.setEnabled(false)- analytics.capture(.appOpened)+ analytics.capture(.appOpened())#expect(analytics.pending.isEmpty)// Signed out: the install ID with its own person profile, the common properties.analytics.setEnabled(true)- analytics.capture(.computerPaired, ["via": "qr"])+ analytics.capture(.computerPaired(via: .qr, computer: "AAECAwQFBgcICQoLDA0ODw"))let anon = try #require(analytics.pending.first)#expect(anon.event == "computer_paired")#expect(anon.properties["via"] == .string("qr"))+ #expect(anon.properties["computer"] == .string("2d6878bee20aba04"))#expect(anon.properties["$process_person_profile"] == .bool(true))#expect(anon.properties["$lib"] == .string("codync-ios"))#expect(anon.properties["$os"] == .string("iOS"))@@ -29,8 +30,8 @@ import Testing// Signed in: $identify links the install ID once, then events carry the user ID.analytics.userID = { "user_1" }- analytics.capture(.signedIn)- analytics.capture(.voiceCallStarted)+ analytics.capture(.signedIn(.apple))+ analytics.capture(.voiceCallStarted(.onDevice))let names = analytics.pending.map(\.event)#expect(names == ["computer_paired", "$identify", "signed_in", "voice_call_started"])let identify = analytics.pending[1]@@ -46,6 +47,36 @@ import Testing#expect(analytics.pending.isEmpty)}+@Test func eventPropertiesAreTypedAndUseTheCatalogNames() throws {+ func json(_ event: AnalyticsEvent) throws -> String {+ let encoder = JSONEncoder()+ encoder.outputFormatting = .sortedKeys+ return String(decoding: try encoder.encode(event.properties), as: UTF8.self)+ }+ // Booleans and counts go out as JSON booleans and numbers, not strings.+ #expect(try json(.appOpened(notifications: .notAsked, widgets: 2)) == #"{"notifications":"not_asked","widgets":2}"#)+ #expect(try json(.appOpened()) == "{}")+ #expect(try json(.notificationsAnswered(granted: false, source: .widgets)) == #"{"granted":false,"source":"widgets"}"#)+ #expect(try json(.settingChanged(.liveActivities, on: true)) == #"{"on":true,"setting":"live_activities"}"#)+ // Multi-word values are snake_case, as in the catalog.+ #expect(try json(.signInFailed(.google, reason: .cancelled)) == #"{"provider":"google","reason":"cancelled"}"#)+ #expect(try json(.screenViewed(.botDetails)) == #"{"screen":"bot_details"}"#)+ #expect(try json(.voiceCallStarted(.onDevice)) == #"{"engine":"on_device"}"#)+ #expect(try json(.linkOpened(.installCommand)) == #"{"link":"install_command"}"#)+ #expect(AnalyticsEvent.notificationOpened(.needsInput).name == "notification_opened")+ #expect(AnalyticsEvent.NotificationKind(category: "needsInput") == .needsInput)+ #expect(AnalyticsEvent.NotificationKind(category: "other") == nil)++ // Why pairing failed: a category, never the error's text; called off isn't a failure.+ #expect(AnalyticsEvent.PairingFailure(Pairing.Problem.outdatedHost) == .outdatedHost)+ #expect(AnalyticsEvent.PairingFailure(HostError.http(401, "secret")) == .unauthorized)+ #expect(AnalyticsEvent.PairingFailure(HostError.http(403, "This pairing code expired.")) == .expired)+ #expect(AnalyticsEvent.PairingFailure(HostError.computerOffline(lastSeen: nil)) == .unreachable)+ #expect(AnalyticsEvent.PairingFailure(URLError(.timedOut)) == .timeout)+ #expect(AnalyticsEvent.PairingFailure(CocoaError(.fileNoSuchFile)) == .other)+ #expect(AnalyticsEvent.PairingFailure(CancellationError()) == nil)+}+@MainActor@Test func crashReportsSendNamesAndFramesButNoMessage() throws {// MetricKit's call-stack JSON: the root frame crashed, each first sub-frame is its caller.@@ -114,15 +145,15 @@ import Testing// The first launch ever has no session to put a crash in.let first = Analytics(defaults: defaults) { _ in false }first.recordCrash([:])- first.capture(.appOpened)- first.capture(.voiceCallStarted)+ first.capture(.appOpened())+ first.capture(.voiceCallStarted(.cloud))let sessions = first.pending.map { $0.properties["$session_id"] }#expect(sessions[0] == nil && sessions[1] != nil && sessions[1] == sessions[2])// The next launch starts its own session; a crash MetricKit reports then belongs to the last one.let next = Analytics(defaults: defaults) { _ in false }next.recordCrash([:])- next.capture(.appOpened)+ next.capture(.appOpened())#expect(next.pending[0].properties["$session_id"] == sessions[1])#expect(next.pending[1].properties["$session_id"] != sessions[1])}diff --git a/apps/ios/Views/AccountSwitcherView.swift b/apps/ios/Views/AccountSwitcherView.swiftindex 027cbbef..35151674 100644--- a/apps/ios/Views/AccountSwitcherView.swift+++ b/apps/ios/Views/AccountSwitcherView.swift@@ -87,6 +87,7 @@ struct AccountSwitcherView: View {}.animation(Motion.layout, value: account.userID).animation(Motion.fade, value: account.errorMessage)+ .tracked(.screenViewed(.account)).onChange(of: account.userID) { _, _ in withAnimation(Motion.layout) { addingAccount = false } }.hidesSystemNavigationBar().navigationDestination(isPresented: $showSettings) { SettingsView(pushed: true) }diff --git a/apps/ios/Views/ActivityGalleryView.swift b/apps/ios/Views/ActivityGalleryView.swiftindex 5627f154..aceef3b3 100644--- a/apps/ios/Views/ActivityGalleryView.swift+++ b/apps/ios/Views/ActivityGalleryView.swift@@ -34,7 +34,11 @@ struct ActivityGalleryView: View {ScrollView {VStack(alignment: .leading, spacing: 24) {VStack(alignment: .leading, spacing: 10) {- Toggle(island ? "Show in Dynamic Island" : "Show Live Activities", isOn: $enabled)+ // Recorded from the switch itself: both galleries share the setting and stay alive.+ Toggle(island ? "Show in Dynamic Island" : "Show Live Activities", isOn: Binding(get: { enabled }, set: { on in+ enabled = on+ Analytics.shared.capture(.settingChanged(.liveActivities, on: on))+ })).toggleStyle(.codync).font(.subheadline.weight(.medium))Text(islanddiff --git a/apps/ios/Views/PairingView.swift b/apps/ios/Views/PairingView.swiftindex 4409cbd5..64b9d804 100644--- a/apps/ios/Views/PairingView.swift+++ b/apps/ios/Views/PairingView.swift@@ -62,6 +62,8 @@ struct PairingView<Leading: View>: View {}}.background(Palette.background)+ // First run, each page is an onboarding step; afterwards, the whole sheet is one screen.+ .tracked(inModal ? .screenViewed(.pairing) : .onboardingStepViewed(step == .install ? .install : .scan))}private func go(_ next: Step) {@@ -112,14 +114,14 @@ private struct InstallPage: View {// Copied here, pasted on the computer (Universal Clipboard or a message to yourself).if os == .mac {Hint("Install with Homebrew")- CommandBlock("brew install --cask leepokai/codync/codync")+ CommandBlock("brew install --cask leepokai/codync/codync", records: .installCommand)Hint("or download the Mac app")- CommandBlock("https://github.com/leepokai/Codync/releases/latest/download/codync-macos.dmg")+ CommandBlock("https://github.com/leepokai/Codync/releases/latest/download/codync-macos.dmg", records: .installCommand)} else {Hint("Run the installer")- CommandBlock("curl -fsSL https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh | sh\ncodync-host install")+ CommandBlock("curl -fsSL https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh | sh\ncodync-host install", records: .installCommand)Hint("or install with Homebrew")- CommandBlock("brew install leepokai/codync/codync-host\ncodync-host install")+ CommandBlock("brew install leepokai/codync/codync-host\ncodync-host install", records: .installCommand)}Text(os == .mac? "Open Codync and it sets up the host on its own."@@ -128,7 +130,7 @@ private struct InstallPage: View {.foregroundStyle(Palette.secondary).contentTransition(.opacity)Hint("Every install option")- CommandBlock("https://www.codync.dev/#install")+ CommandBlock("https://www.codync.dev/#install", records: .installCommand)}.animation(Motion.layout, value: os)@@ -158,12 +160,16 @@ private struct Hint: View {}}-/// A terminal command with a copy button.+/// A terminal command with a copy button; copying it counts as opening `records`.private struct CommandBlock: View {let command: String+ let records: AnalyticsEvent.Link?@State private var copied = false- init(_ command: String) { self.command = command }+ init(_ command: String, records: AnalyticsEvent.Link? = nil) {+ self.command = command+ self.records = records+ }var body: some View {HStack(alignment: .top, spacing: 8) {@@ -176,6 +182,7 @@ private struct CommandBlock: View {.contentTransition(.opacity)IconButton(copied ? "Copied" : "Copy", systemImage: copied ? "checkmark" : "doc.on.doc") {UIPasteboard.general.string = command+ if let records { Analytics.shared.capture(.linkOpened(records)) }withAnimation(Motion.morph) { copied = true }Task {try? await Task.sleep(for: .seconds(1.5))@@ -263,7 +270,10 @@ private struct ScanPage: View {if tailscaleOn {Label("Tailscale is on: Codync connects over it directly.", systemImage: "checkmark.circle.fill")} else {- Button { openURL(Tailscale.downloadURL) } label: {+ Button {+ Analytics.shared.capture(.linkOpened(.tailscale))+ openURL(Tailscale.downloadURL)+ } label: {Label("Use Tailscale? Direct and faster away from home.", systemImage: "arrow.up.right")}.buttonStyle(PressScale())@@ -308,7 +318,7 @@ private struct ScanPage: View {private func pair(_ text: String) {let p: Pairingdo {- p = try Pairing.parse(text.trimmingCharacters(in: .whitespacesAndNewlines))+ p = try app.pairing(from: text.trimmingCharacters(in: .whitespacesAndNewlines))} catch {show(error)return@@ -318,7 +328,7 @@ private struct ScanPage: View {Task {defer { pairing = false }do {- _ = try await app.pair(p)+ _ = try await app.pair(p, via: .qr)pasted = ""paired()} catch {diff --git a/apps/ios/Views/RootView.swift b/apps/ios/Views/RootView.swiftindex 27efe96d..4b89f959 100644--- a/apps/ios/Views/RootView.swift+++ b/apps/ios/Views/RootView.swift@@ -24,7 +24,7 @@ struct RootView: View {WelcomeView { withAnimation(Motion.reduced(Motion.layout, reduceMotion)) { welcomed = true } }.transition(.move(edge: .leading).combined(with: .opacity))} else {- PairingView(onSkip: { onboardingCompleted = true }) {+ PairingView(onSkip: { completeOnboarding(via: .skipped) }) {if account.isSignedIn {AccountSwitcherButton()} else {@@ -41,7 +41,7 @@ struct RootView: View {.onChange(of: accounts.computers.isEmpty && accounts.cloudComputers.isEmpty, initial: true) { _, empty in// Pairing, signing in to an account that has computers, or explicitly skipping completes// setup. Keep this device-level milestone across account changes and unpairing.- if !empty { onboardingCompleted = true }+ if !empty { completeOnboarding(via: accounts.cloudComputers.isEmpty ? .paired : .account) }}.codyncDialog("Something went wrong", isPresented: errorShown, message: errorMessage, cancel: "OK", inPlace: true) { [] }.codyncOverlay(isPresented: Binding(get: { screenTarget.wrappedValue != nil }, set: { if !$0 { screenTarget.wrappedValue = nil } })) { close in@@ -88,10 +88,18 @@ struct RootView: View {}}.tint(Palette.text)+ .tracked(.screenViewed(app.tab == .bots ? .bots : .state))// Opening a bot (notification, widget, link) always lands on the Bots tab..onChange(of: accounts.selection) { _, ref in if ref != nil { app.tab = .bots } }}+ /// Once per setup (Start over begins a new one): the first computer reached, or Skip.+ private func completeOnboarding(via: AnalyticsEvent.OnboardingVia) {+ guard !onboardingCompleted else { return }+ onboardingCompleted = true+ Analytics.shared.capture(.onboardingCompleted(via: via))+ }+// MARK: one place for every computer's errors and screen requestsprivate var errorMessage: String? {@@ -237,6 +245,7 @@ private struct UsageSheet: View {}}.background(Palette.background)+ .tracked(.screenViewed(.usage))}}diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swiftindex 2c3cc465..b57bd4e1 100644--- a/apps/ios/Views/SettingsView.swift+++ b/apps/ios/Views/SettingsView.swift@@ -74,7 +74,10 @@ struct SettingsView: View {CardSection("Notifications", footer: "Get a result summary, a request for input, or a failure notice. Notification previews follow your iOS settings.") {Toggle("Push notifications", isOn: $notificationsEnabled).toggleStyle(.codync)- .onChange(of: notificationsEnabled) { PushRegistrar.shared.resync() }+ .onChange(of: notificationsEnabled) { _, on in+ PushRegistrar.shared.resync()+ Analytics.shared.capture(.settingChanged(.push, on: on))+ }notificationsRow}@@ -109,7 +112,10 @@ struct SettingsView: View {CardSection {ValueRow("App version", value: Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "")- Button("Source code") { openURL(URL(string: "https://github.com/leepokai/Codync")!) }+ Button("Source code") {+ Analytics.shared.capture(.linkOpened(.github))+ openURL(URL(string: "https://github.com/leepokai/Codync")!)+ }.buttonStyle(.plain).foregroundStyle(Palette.text)}@@ -136,6 +142,8 @@ struct SettingsView: View {}.refreshable { await accounts.refreshCloud() }.page("Computers & settings", pushed: pushed)+ // One screen, named for the way in (as on Android): Accounts → settings, the Computers sheet → computers.+ .tracked(.screenViewed(pushed ? .settings : .computers)).task { await accounts.refreshCloud() }.codyncSheet(isPresented: $addingComputer) {PairingView(inModal: true)@@ -218,7 +226,7 @@ struct SettingsView: View {if notificationsAllowed != nil {UIApplication.shared.open(URL(string: UIApplication.openNotificationSettingsURLString)!)} else {- Task { notificationsAllowed = await PushRegistrar.shared.requestAuthorization() }+ Task { notificationsAllowed = await PushRegistrar.shared.requestAuthorization(from: .settings) }}} label: {ValueRow("Notifications", value: notificationsAllowed == true ? "On" : notificationsAllowed == false ? "Off in Settings" : "Turn on")diff --git a/apps/ios/Views/WelcomeView.swift b/apps/ios/Views/WelcomeView.swiftindex 211cdac3..82b44247 100644--- a/apps/ios/Views/WelcomeView.swift+++ b/apps/ios/Views/WelcomeView.swift@@ -19,6 +19,7 @@ struct WelcomeView: View {.scrollBounceBehavior(.basedOnSize)}.background(Palette.background)+ .tracked(.onboardingStepViewed(.welcome)).task {if reduceMotion { beat = 4; return }for next in 1...4 {@@ -152,6 +153,7 @@ struct DemoButton: View {.font(.subheadline.weight(.medium)).foregroundStyle(Palette.text)}+ .trackedLinks(.demo)}}diff --git a/apps/ios/Views/WidgetGalleryView.swift b/apps/ios/Views/WidgetGalleryView.swiftindex dab89ad8..4fe9e36f 100644--- a/apps/ios/Views/WidgetGalleryView.swift+++ b/apps/ios/Views/WidgetGalleryView.swift@@ -224,7 +224,7 @@ struct WidgetGalleryView: View {UIApplication.shared.open(URL(string: UIApplication.openNotificationSettingsURLString)!)} else {Task {- _ = await PushRegistrar.shared.requestAuthorization()+ _ = await PushRegistrar.shared.requestAuthorization(from: .widgets)await checkNotifications()}}diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.mdindex 751f3f8d..4f6c32d6 100644--- a/apps/ios/WhatsNew.md+++ b/apps/ios/WhatsNew.md@@ -13,9 +13,13 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o- 設定 Routine 排程更簡單:選擇每小時、每天、平日或每週,再挑時間就好;需要更細的排程時,仍可用「自訂」直接輸入 cron。- 時區改成可搜尋的清單,打幾個字就能找到,預設是你目前所在的時區。- 新版本一上架,更新提醒就會出現,不再晚上一天。+- 使用分析現在也會記錄你開啟哪些畫面、設定與配對走到哪一步,以及是否允許通知,讓我們看出大家在哪裡卡住。仍然不會記錄你的訊息、程式碼或檔案,隨時可以在設定裡關閉。+- 背景時更可靠地送出使用分析,切出 App 也不會漏掉。### en-US- Setting a routine's schedule is simpler: pick hourly, daily, weekdays or weekly, then the time. Custom still takes a cron for anything finer.- Time zones come from a searchable list, found in a few keystrokes, starting from the one you're in.- The update reminder shows up as soon as a new version is in the App Store, not a day later.+- Usage analytics now also count which screens you open, how far setup and pairing get, and whether you allow notifications, so we can see where people get stuck. Never your messages, code or files, and you can still turn it off in Settings.+- Usage analytics are sent more reliably when you leave the app.