learning_ai_clock/ios/ChronoMind/Shared/Diagnostics/CrashReporter.swift
saravanakumardb1 3adab843cd refactor(ios): migrate CrashReporter to ByteLystPlatformSDK's BLCrashReporter
Replaced standalone MetricKit crash reporter (153 lines) with thin wrapper (34 lines)
delegating to SDK's BLCrashReporter. Preserves existing call-site API.
2026-02-28 22:38:55 -08:00

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
}
}