import FirebaseCrashlytics enum CrashlyticsService { static func setUserProperties(isPremium: Bool) { Crashlytics.crashlytics().setCustomValue(isPremium, forKey: "is_premium") } static func log(_ message: String) { Crashlytics.crashlytics().log(message) } static func record(_ error: Error, context: String? = nil) { var userInfo: [String: Any] = [:] if let context { userInfo["context"] = context } Crashlytics.crashlytics().record(error: error, userInfo: userInfo) } static func record(message: String, context: String? = nil) { let userInfo: [String: Any] = context.map { ["context": $0] } ?? [:] Crashlytics.crashlytics().record( exceptionModel: ExceptionModel(name: "AppError", reason: message), userInfo: userInfo ) } }