Replaced standalone MetricKit crash reporter (153 lines) with thin wrapper (34 lines) delegating to SDK's BLCrashReporter. Preserves existing call-site API.
34 lines
993 B
Swift
34 lines
993 B
Swift
// ── Crash Reporter ────────────────────────────────────────────
|
|
// Wrapper over ByteLystPlatformSDK's BLCrashReporter.
|
|
// Preserves existing call-site API (CrashReporter.shared, loadCrashReports, clearReports).
|
|
|
|
import Foundation
|
|
import ByteLystPlatformSDK
|
|
|
|
typealias CrashReport = BLCrashReport
|
|
|
|
@MainActor
|
|
final class CrashReporter: ObservableObject {
|
|
static let shared = CrashReporter()
|
|
|
|
@Published var lastCrashReport: Date?
|
|
@Published var diagnosticCount: Int = 0
|
|
|
|
private let reporter: BLCrashReporter
|
|
|
|
private init() {
|
|
reporter = BLCrashReporter(productId: "chronomind")
|
|
diagnosticCount = reporter.diagnosticCount
|
|
lastCrashReport = reporter.lastCrashReport
|
|
}
|
|
|
|
func loadCrashReports() -> [CrashReport] {
|
|
reporter.loadCrashReports()
|
|
}
|
|
|
|
func clearReports() {
|
|
reporter.clearReports()
|
|
diagnosticCount = 0
|
|
}
|
|
}
|