Location information on HKWorkout?

If I use the Apple training app on Apple Watch, indoor trainings like swimming in a pool will also store a location which I can see later in the Fitness app on the iPhone.

My question: How do I store these location information with my own workout app on the watch?

I tried creating a HKWorkoutRoute with the HKWorkoutRouteBuilder and added only one location. It saves fine, but the location does not appear in the Fitness app.

If I query a workout recorded with the Apple training app on the iPhone, it also looks like there is no connected HKWorkoutRoute data stored.

I also can not find any metadata key or something which I can use instead.

Replies

Hi Andre. I consulted with the HealthKit team.

  • Please file an enhancement request regarding storing the location of the swim workout.
  • The stroke style should be recognized by HealthKit automatically, but if this is not working, please file a bug report.
  • Please also file an enhancement request regarding swim workouts that don't have any arm movements.

I hope this information is helpful to you.

Hi. Thank you!

Here are the feedbacks I created:

  • FB9810882: Location metakeys for indoor swim workouts
  • FB9810895: Swim stroke style not displayed in workout summary in Fitness app
  • FB9810889: Extend HKSwimmingStrokeStyle