HealthKit single workout location

488 Views Asked by At

Workouts recorded by Apple Workouts app on Apple Watch assign a location to stationary workouts, which is displayed as a pin in the Apple Fitness app.

enter image description here

This does not seem to be a HKWorkoutRoute (displayed as a route heatmap in Apple Fitness), which is used for workouts that have moved (such as cycling or running), as trying to load the HKWorkoutRoute for this workout leads to an empty list.

It's not a workout metadata either (like weather and humidity are). The documentation from Apple only offers guidance on HKWorkoutRoutes and not this singular location property.

How is this single location added to workouts from Apple Workouts, how can I as a developer read the location to display a map with a pin in my app, and how can I as a developer assign a location to the workouts I am writing to Apple Health, to ensure the best interoperability with Apple Fitness and other apps reading my workout type?

1

There are 1 best solutions below

3
On BEST ANSWER

This is stored/used by Workout/Fitness apps and isn't available as API. You can try storing a workout route with a single location to get effectively the same behaviour for your app.