diff --git a/ios/App/CoachWatch/WorkoutManager.swift b/ios/App/CoachWatch/WorkoutManager.swift index 91affb9..ce95691 100644 --- a/ios/App/CoachWatch/WorkoutManager.swift +++ b/ios/App/CoachWatch/WorkoutManager.swift @@ -44,6 +44,10 @@ final class WorkoutManager: NSObject, ObservableObject { try await healthStore.requestAuthorization(toShare: share, read: read) let woStatus = healthStore.authorizationStatus(for: HKQuantityType.workoutType()) workoutLog.info("requestAuthorization OK; workoutType share status=\(woStatus.rawValue)") + if woStatus == .sharingDenied { + statusMessage = "Accès Santé refusé. Active Coach dans Réglages → Santé → Accès aux données, puis relance." + return + } } catch { workoutLog.error("requestAuthorization threw: \(error.localizedDescription)") statusMessage = "Autorisation Santé refusée : \(error.localizedDescription)"