From f1fae05b702eb99f8b8a1f340a4212bbd3cd5388 Mon Sep 17 00:00:00 2001 From: Alex Grebenyuk Date: Fri, 12 Jun 2026 13:45:28 -0400 Subject: [PATCH] Report tvOS platform in LiveAnalyticsStreamer The Live analytics adapter is registered on the tvOS target but hardcoded platform: "iOS", mislabeling every tvOS event. Resolve the platform at compile time via #if os(tvOS), matching the TracksAdapter pcios/pctvos split. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Analytics/Adapters/LiveAnalyticsStreamer.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/podcasts/Analytics/Adapters/LiveAnalyticsStreamer.swift b/podcasts/Analytics/Adapters/LiveAnalyticsStreamer.swift index fa243dff51..9dea8df592 100644 --- a/podcasts/Analytics/Adapters/LiveAnalyticsStreamer.swift +++ b/podcasts/Analytics/Adapters/LiveAnalyticsStreamer.swift @@ -49,6 +49,14 @@ actor LiveAnalyticsStreamer: AnalyticsAdapter { private let encoder = JSONEncoder() + private static let platform: String = { +#if os(tvOS) + "tvOS" +#else + "iOS" +#endif + }() + private let dateFormatter: ISO8601DateFormatter = { let formatter = ISO8601DateFormatter() formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] @@ -65,7 +73,7 @@ actor LiveAnalyticsStreamer: AnalyticsAdapter { properties: properties.reduce(into: [String: String]()) { result, entry in result[entry.key] = String(describing: entry.value) }, - platform: "iOS" + platform: Self.platform ) bufferEvent(event) }