I am working on a fitness app where for now I don't want to gain any data through HealthKit. Actually, keeping my app in the background via HKWorkoutSession was the only thing which forced me to use HealtKit for now.
The problem which I have is that heart rate sensor is running when I stop a workout for ~30sec and sometimes he doesn't want to turn off even after this time. I noticed that for example, Strava app has an active workout session when running and he doesn't turn on heart LEDs when it's active, paused or stopped which is a behavior which I would like to achieve as well but after many tries with different HKWorkoutConfiguration I couldn't.
For example:
let workoutConfiguration = HKWorkoutConfiguration()
workoutConfiguration.activityType = .running
workoutConfiguration.locationType = .unknown
I double checked that I don't reuse previous session or the don't have active session.
For above configuration, the heart rate LEDs are disabled when workout session is active but when I stop it, they glow and usually go out after 30 seconds (except the cases when they don't want to turn off and I don't have any steps to reproduce, for me it looks totally randomly)
Did anyone use HKWorkoutConfiguration with totally disabled heart rate or faced some issues when the heart rate sensor didn't want to turn off?