Recommended HealthKit representation for self-reported focus sessions?

We ship a focus timer where every session is user-initiated: the user deliberately starts a 25- or 45-minute session, then it's logged. We'd like that focused time to live in the user's health picture alongside sleep, exercise, and State of Mind, as self-reported context — the same standing as manually entered steps, and never inferred from device usage.

The nearest interval type today is HKCategoryTypeIdentifier.mindfulSession, but its semantics are meditation. Is writing focused-work intervals to mindfulSession considered a misuse of the type? And if so, what's the recommended way to represent self-reported focus time until a dedicated type exists?

Answered by Frameworks Engineer in 892533022

The HKCategoryTypeIdentifier.mindfulSession is intended to capture mindfulness or meditation sessions. Based on your description, this does not seem like the proper use of HKCategoryTypeIdentifier.mindfulSession as the value is also read by other clients and may create a confusing user experience.

Please file a detailed feedback radar explaining your use case and user experience. Thank you!

The HKCategoryTypeIdentifier.mindfulSession is intended to capture mindfulness or meditation sessions. Based on your description, this does not seem like the proper use of HKCategoryTypeIdentifier.mindfulSession as the value is also read by other clients and may create a confusing user experience.

Please file a detailed feedback radar explaining your use case and user experience. Thank you!

Recommended HealthKit representation for self-reported focus sessions?
 
 
Q