feat: move HealthKit permission to onboarding, remove HR write
- Add .health step to onboarding between frequency and ready - HealthStep with non-blocking permission flow (Not Now skips) - Remove requestAuthorization() from PlayerViewModel.startWorkout() - Guard live session start with isAuthorized check - Remove heart rate write from HealthKit authorization popup - Remove HR sample writing from saveWorkout (now without permission) - Add L10n keys: healthAccess, healthAccessSubtitle, allowHealthAccess, notNow - Add EN/DE/ES/FR translations - Track permission decisions through analytics - Entry animation on HealthStep (fade-in + slide-up) HealthKit permission is now asked once during onboarding, never interrupting workouts again.
This commit is contained in:
@@ -137,7 +137,11 @@ final class PlayerViewModel: ObservableObject {
|
||||
|
||||
// Start HealthKit live session
|
||||
Task {
|
||||
try? await HealthKitService.shared.requestAuthorization()
|
||||
guard await HealthKitService.shared.isAuthorized else {
|
||||
print("[PlayerVM] HealthKit not authorized — skipping live session")
|
||||
return
|
||||
}
|
||||
|
||||
liveSession.onHeartRateUpdate = { [weak self] hr in
|
||||
Task { @MainActor in self?.heartRate = hr }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user