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.
This commit is contained in:
@@ -18,6 +18,10 @@ actual object PostHogAnalytics {
|
||||
// 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
|
||||
}
|
||||
@@ -29,4 +33,8 @@ actual object PostHogAnalytics {
|
||||
actual fun flush() {
|
||||
// iOS uses Swift PostHogAnalytics.shared.flush() directly
|
||||
}
|
||||
|
||||
actual fun setupExceptionHandler() {
|
||||
// iOS exception handler is set up in Swift via AnalyticsManager.setupExceptionHandler()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user