Fix iOS analytics by calling Swift AnalyticsManager instead of Kotlin no-op stub

PostHogAnalytics.shared.initialize() was calling the Kotlin actual object which
is a no-op on iOS. Replaced with AnalyticsManager.shared.configure() so the
PostHog SDK actually initializes. Also switched to anonymous-only person profiles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-03-03 21:28:27 -06:00
parent 233fb08cce
commit bf5d60ca63
3 changed files with 4 additions and 7 deletions

View File

@@ -41,9 +41,8 @@ final class AnalyticsManager {
let config = PostHogConfig(apiKey: Self.apiKey, host: Self.host)
// Person profiles required so events create person records
// and appear in the PostHog Events Explorer / Activity view.
config.personProfiles = .always
// Anonymous-only no user identification, events use anonymous IDs
config.personProfiles = .never
// Auto-capture
config.captureElementInteractions = true

View File

@@ -146,8 +146,6 @@ class LoginViewModel: ObservableObject {
// APILayer.logout clears DataManager
try? await APILayer.shared.logout()
SubscriptionCacheWrapper.shared.clear()
PushNotificationManager.shared.clearRegistrationCache()

View File

@@ -45,8 +45,8 @@ struct iOSApp: App {
TokenStorage.shared.initialize(manager: TokenManager.Companion.shared.getInstance())
if !UITestRuntime.isEnabled {
// Initialize PostHog Analytics
PostHogAnalytics.shared.initialize()
// Initialize PostHog Analytics (must use Swift AnalyticsManager, not the Kotlin stub)
AnalyticsManager.shared.configure()
}
// Initialize lookups at app start (public endpoints, no auth required)