Add PostHog analytics to replace removed Firebase

Wire PostHog iOS SDK into existing EventLogger pattern so all 60+
call sites flow to self-hosted PostHog instance with zero changes.
Sets subscription person properties for segmentation on foreground.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-10 13:57:30 -06:00
parent 7cb5bdfb40
commit a08d0d33c0
4 changed files with 69 additions and 4 deletions

View File

@@ -6,14 +6,17 @@
//
import Foundation
// import Firebase // Firebase removed
#if canImport(PostHog)
import PostHog
#endif
class EventLogger {
static func log(event: String, withData data: [String: Any]? = nil) {
// Firebase Analytics disabled
// Analytics.logEvent(event, parameters: data)
#if DEBUG
print("[EventLogger] \(event)", data ?? "")
#endif
#if canImport(PostHog)
PostHogSDK.shared.capture(event, properties: data)
#endif
}
}