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:
@@ -17,6 +17,10 @@ actual object PostHogAnalytics {
|
||||
// No-op for desktop
|
||||
}
|
||||
|
||||
actual fun captureException(throwable: Throwable, properties: Map<String, Any>?) {
|
||||
// No-op for desktop
|
||||
}
|
||||
|
||||
actual fun screen(screenName: String, properties: Map<String, Any>?) {
|
||||
// No-op for desktop
|
||||
}
|
||||
@@ -28,4 +32,8 @@ actual object PostHogAnalytics {
|
||||
actual fun flush() {
|
||||
// No-op for desktop
|
||||
}
|
||||
|
||||
actual fun setupExceptionHandler() {
|
||||
// No-op for desktop
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user