diff --git a/packages/swift-platform-sdk/Sources/BLBiometricAuth.swift b/packages/swift-platform-sdk/Sources/BLBiometricAuth.swift index 0c55faed..9435ec69 100644 --- a/packages/swift-platform-sdk/Sources/BLBiometricAuth.swift +++ b/packages/swift-platform-sdk/Sources/BLBiometricAuth.swift @@ -1,11 +1,15 @@ // ── Biometric Authentication ──────────────────────────────── // Generic Face ID / Touch ID wrapper using LocalAuthentication. // Product apps pass a custom reason string for the biometric prompt. +// Not available on watchOS — guarded with #if canImport. import Foundation + +#if canImport(LocalAuthentication) import LocalAuthentication -/// Generic biometric authentication for all ByteLyst iOS apps. +/// Generic biometric authentication for all ByteLyst iOS/macOS apps. +/// Not available on watchOS (LocalAuthentication is iOS/macOS only). public enum BLBiometricAuth { public enum BiometricType { @@ -70,3 +74,4 @@ public enum BLBiometricAuth { } } } +#endif diff --git a/packages/swift-platform-sdk/Sources/BLCrashReporter.swift b/packages/swift-platform-sdk/Sources/BLCrashReporter.swift index d1d24428..4151fb06 100644 --- a/packages/swift-platform-sdk/Sources/BLCrashReporter.swift +++ b/packages/swift-platform-sdk/Sources/BLCrashReporter.swift @@ -2,11 +2,12 @@ // Generic MetricKit-based crash and performance reporting. // Stores crash diagnostics locally for debugging and feedback forms. // Product apps configure with a product-specific persistence key. +// Not available on watchOS — MetricKit is iOS/macOS only. import Foundation -import MetricKit /// Crash report model stored locally. +/// Available on all platforms (data-only struct). public struct BLCrashReport: Codable, Identifiable, Sendable { public let id: String public let date: Date @@ -25,8 +26,12 @@ public struct BLCrashReport: Codable, Identifiable, Sendable { } } -/// Generic MetricKit crash reporter for all ByteLyst iOS apps. +#if canImport(MetricKit) +import MetricKit + +/// Generic MetricKit crash reporter for all ByteLyst iOS/macOS apps. /// Subscribes to MetricKit, stores crash reports in UserDefaults. +/// Not available on watchOS (MetricKit is iOS 13+ / macOS 12+ only). @MainActor public final class BLCrashReporter: NSObject, ObservableObject, MXMetricManagerSubscriber { @@ -127,3 +132,4 @@ public final class BLCrashReporter: NSObject, ObservableObject, MXMetricManagerS diagnosticCount = loadCrashReports().count } } +#endif