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:
@@ -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
|
||||
|
||||
@@ -146,8 +146,6 @@ class LoginViewModel: ObservableObject {
|
||||
// APILayer.logout clears DataManager
|
||||
try? await APILayer.shared.logout()
|
||||
|
||||
|
||||
|
||||
SubscriptionCacheWrapper.shared.clear()
|
||||
PushNotificationManager.shared.clearRegistrationCache()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user