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.
41 lines
1.3 KiB
Kotlin
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()
|
|
}
|
|
}
|