Files
honeyDueKMP/composeApp/src/iosMain/kotlin/com/tt/honeyDue/analytics/PostHogAnalytics.ios.kt
Trey T e4dc3ac30b Add PostHog exception capture for crash reporting
Android: uncaught exception handler sends $exception events with stack
trace to PostHog, flushes before delegating to default handler.
iOS: NSSetUncaughtExceptionHandler captures crashes via PostHogSDK,
avoids @MainActor deadlock by calling SDK directly.
Common: captureException() available for non-fatal catches app-wide.
Platform stubs for jvm/js/wasmJs.
2026-03-26 16:49:30 -05:00

41 lines
1.3 KiB
Kotlin

package com.tt.honeyDue.analytics
/**
* iOS implementation of PostHog Analytics.
* Note: The actual PostHog SDK calls are made from Swift code.
* This is a stub that does nothing - iOS uses the native Swift wrapper directly.
*/
actual object PostHogAnalytics {
actual fun initialize() {
// iOS initialization is done in Swift via PostHogAnalytics.swift
}
actual fun identify(userId: String, properties: Map<String, Any>?) {
// iOS uses Swift PostHogAnalytics.shared.identify() directly
}
actual fun capture(event: String, properties: Map<String, Any>?) {
// iOS uses Swift PostHogAnalytics.shared.capture() directly
}
actual fun captureException(throwable: Throwable, properties: Map<String, Any>?) {
// iOS exception capture is done in Swift via AnalyticsManager
}
actual fun screen(screenName: String, properties: Map<String, Any>?) {
// iOS uses Swift PostHogAnalytics.shared.screen() directly
}
actual fun reset() {
// iOS uses Swift PostHogAnalytics.shared.reset() directly
}
actual fun flush() {
// iOS uses Swift PostHogAnalytics.shared.flush() directly
}
actual fun setupExceptionHandler() {
// iOS exception handler is set up in Swift via AnalyticsManager.setupExceptionHandler()
}
}