Health & Fitness

RSS for tag

Explore the technical aspects of health and fitness features, including sensor data acquisition, health data processing, and integration with the HealthKit framework.

Health & Fitness Documentation

Posts under Health & Fitness subtopic

Post

Replies

Boosts

Views

Activity

Detecting External Heart Rate Monitor Availability
I've noticed that the Fitness app on the iPhone can rapidly detect the presence of an Apple Watch or External Heart Rate Monitor (e.g., AirPods Pro 3) so that it can adjust the availability of certain exercise types. Is this done through an API that is public? Can third party fitness apps access similar functionality so users can be pre-alerted to the availability of workout types that require a heart rate sensor of some sort?
2
0
160
16h
Cycling VO2max
Can Apple Watch please add support for cycling VO2max algorithm and tracking? I sheared my meniscus trail running, ending my running career, and I’m solely cycling for cardio now. I’ve now had to adopt a xxxxxx watch which supports cycling VO2max calc and tracking, and I miss my Apple Watch. Enabling BT pairing to a power meter would provide HR-Power-Cadence (or with a head unit synched to a pm ++ Speed and VAM)
4
0
85
1d
Saving workout routes on the phone when locked
I'm using HKLiveWorkoutDataSource and HKWorkoutRouteBuilder. The running workouts my app supports can be timed or distance-based, so the user may complete the workout while the phone is locked. In this case, the workout route cannot be saved because HealthKit is locked. To work around this issue, I save route data to the device and listen for UIApplication.protectedDataDidBecomeAvailableNotification to later add the route to the workout. Note, this is not needed on the watch, just the phone. Is this limitation by design, or is there a better way to handle it? BTW, thanks for making these APIs available on the phone in iOS 26 and also adding the heart rate zone APIs in 27
3
0
92
1d
Editing Apple Health Workouts
Sometimes my users would like to update an Apple Health workout after it's been saved. For example, maybe they forgot to end the workout and want to trim it. Or maybe it was a treadmill workout, and they want to add the stats from the treadmill. The way I've attempted to do this in the past is to create a new HKWorkoutBuilder, call beginCollection, and add the data the user wants to keep from the original workout (events, activities, samples, workout route, and metadata with an incremented HKMetadataKeySyncIdentifier. After all that, I call endCollection() and finishWorkout() on the builder. Is this the right way to go about it? For trimming a workout, it would be great to have a way to just duplicate a workout with an adjusted start and end time and have HealthKit do all the hard work of trimming data.
2
0
56
1d
About measuring running distance in a standard 400m playground
Everyday, when I am running on a standard 400m playground,I suffer that the distance which Apple Watch shows is always about 50m less than the standard 400m. If I run a much longer distance ,the terrible mistake nearly drives me mad. Also, the location the Apple Watch shows is often completely mistaken from the real.In China ,the playground mode still cannot be used, all aspects of the running exercises measuring give us a terrible experience.How could you deal with it and now what methods we have can avoid these problems?!!!
1
0
41
1d
Apple Health vs Siri AI
I have an app which allows users to track metrics not tracked by HealthKit. Where HealthKit is available we do sync there. I haven't had much time to play with it yet so I'm still trying to figure out the scope of what I might do, but I'm interested in adding Siri AI features to the app. I was wondering if there is any general guidance around either submitting non-HealthKit data to Siri AI. Both technical and non-technical. For example, is there any rule against submitting health data to Siri AI? And is there a recommended way to associate data with HealthKit. For example in the app body water percentage can be associated with a Body Mass entry in HealthKit.
1
0
102
1d
When will the bundle identifier parameter change in Apple Health?
Recently, I am developing an app based on user health data tracking, which involves a scenario where a user wears multiple electronic watches. In this case, I need to distinguish the data sources to prevent the data from not being correctly distinguished when the user wears multiple watches. Currently, bundle identifier seems to be a great choice for me, but after trying to read the materials, it seems that after unbinding, I rebind it. Alternatively, rebinding on another phone would cause this parameter to change. Do you have any better ideas?
1
0
45
1d
Academic research inquiry — population-scale circadian data access
I'm a biomedical researcher specializing in chronobiology and circadian time-series analysis. I'm developing cosinor-based algorithms for circadian phenotyping and chronotherapy optimization at the individual level, and I'm at the point where population-scale data would meaningfully improve model calibration. Apple Health's longitudinal passive sensor streams — particularly HRV, sleep staging, resting heart rate, and activity cadence — are well-suited to this kind of work. My question is whether Apple has an established pathway for academic researchers to access aggregate or privacy-preserving representations of Health data (e.g., via differential privacy or federated computation), and if so, what the eligibility and process look like.
2
0
71
1d
About measuring running distance in a standard 400m playground
Everyday, when I am running on a standard 400m playground,I suffer that the distance which Apple Watch shows is always about 50m less than the standard 400m. If I run a much longer distance ,the terrible mistake nearly drives me mad. Also, the location the Apple Watch shows is often completely mistaken from the real.In China ,the playground mode still cannot be used, all aspects of the running exercises measuring give us a terrible experience.How could you deal with it and now what methods we have can avoid these problems?!!!
2
0
44
1d
Checking Apple Health permissions
Is it safe to call HKHealthStore authorizationStatus() and getRequestStatusForAuthorization() on the main thread? It seems that these methods occasionally block. Any best practices for guiding a user to grant all required Apple Health permissions for a workout app? Because of privacy concerns, its difficult to know what permissions a user has granted or denied in order to guide them appropriately.
2
1
104
1d
Health data on iPad via iCloud
What’s the recommended way to determine whether HealthKit data is being accessed on an iPad versus an iPhone? My goal isn’t really to identify the device type itself, but to know whether the HealthKit data is likely being viewed on the device where it was originally recorded, or on a device that receives the data via HealthKit/iCloud syncing. This matters because synced HealthKit data can appear with a delay, and I’d like to set appropriate expectations for users. I previously used UITraitCollection.current.userInterfaceIdiom == .pad as a proxy for this, but that API is being deprecated. Is there a better way to distinguish between locally recorded HealthKit data and data that has arrived via sync, or otherwise identify when the app is running on an iPad?
4
1
135
1d
Medication API suggestions
Since there were not 1:1 labs available for HealthKit, I’d like to just share to the team continued interest in some feedbacks related to Medication API from last year. FB18310503 FB18310200 FB18309972 To update the post with a question, are there any medications API changes since the release in iOS 26.0? There was a short session video last summer but I haven't found anything 'new'.
3
0
68
1d
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?
1
0
64
1d
Where does ResearchKit live in the era of Liquid Glass and SwiftUI-first development?
When will ResearchKit get the needed overhaul to be fully compatible with Liquid Glass? CareKit is a SwiftUI first offering with many customization points, but ResearchKit, its older sibling, hasn’t merged the SwiftUI work. I’d like to see SwiftUI, distribution as a Swift Package, and more frequent versioned releases. Can anything be shared on the state of and plans for ResearchKit going forward? It is open source so there isn’t a good way to file feedback other than just sending to the HealthKit team. FB9558499 FB15694524 FB20292373
1
0
67
1d
Sleep Disturbances API enhancements
Since there were not 1:1 labs available for HealthKit, I’d like to just share to the team continued interest in some feedbacks related to the sleep disturbances API from last year. FB20332832 FB20330679 To make this not just a transfer of feedbacks here is a question. How can you create a sleep disturbance value on the simulator? The Health app allows you to show a sheet to create one, but the values I enter don't seem to be valid and the save button is never functional. FB20979381 - Simulator / HealthKit: The Simulator allows for launching a 'create breathing disturbances' sample but never permits saving
2
1
39
1d
Workout Activities for Interval Training Apps
Workout Activities are very useful for tracking metrics for each interval of a HIIT workout (e.g. Run/Walk or Work/Recover intervals for core body workout). However, if the workout contains lots of intervals (50 or more), I find that saving all those workout activities slow down saving the workout to Apple Health. Is this an appropriate use of workout activities? If so, it would be great to be able to set the activity type for each activity (e.g. run or walk).
1
0
44
1d
How to build better 'help the user' experiences around setting up EMR connections?
How do you suggest developers help users get their EMRs setup and connected? I don’t want to maintain custom instructions that are potentially os-version and device varying. There isn’t a way to deep link the user directly to that page, but if there was that would help me bring more products online with consuming health records, as well as making that recommendation to the user to connect — which helps all apps. FB9950311 Sorta related is the desire to deep link the user to the manage health settings page. Same thing, don’t want to maintain updating documentation I don’t control. My users need help changing their decisions and ‘go to Apple health’ isn’t great. Do you have any recommendations to Apple support articles or other ways to cleanly and simply educate users on how to manage their choices? FB13683502
1
0
50
1d
Detecting External Heart Rate Monitor Availability
I've noticed that the Fitness app on the iPhone can rapidly detect the presence of an Apple Watch or External Heart Rate Monitor (e.g., AirPods Pro 3) so that it can adjust the availability of certain exercise types. Is this done through an API that is public? Can third party fitness apps access similar functionality so users can be pre-alerted to the availability of workout types that require a heart rate sensor of some sort?
Replies
2
Boosts
0
Views
160
Activity
16h
Cycling VO2max
Can Apple Watch please add support for cycling VO2max algorithm and tracking? I sheared my meniscus trail running, ending my running career, and I’m solely cycling for cardio now. I’ve now had to adopt a xxxxxx watch which supports cycling VO2max calc and tracking, and I miss my Apple Watch. Enabling BT pairing to a power meter would provide HR-Power-Cadence (or with a head unit synched to a pm ++ Speed and VAM)
Replies
4
Boosts
0
Views
85
Activity
1d
Saving workout routes on the phone when locked
I'm using HKLiveWorkoutDataSource and HKWorkoutRouteBuilder. The running workouts my app supports can be timed or distance-based, so the user may complete the workout while the phone is locked. In this case, the workout route cannot be saved because HealthKit is locked. To work around this issue, I save route data to the device and listen for UIApplication.protectedDataDidBecomeAvailableNotification to later add the route to the workout. Note, this is not needed on the watch, just the phone. Is this limitation by design, or is there a better way to handle it? BTW, thanks for making these APIs available on the phone in iOS 26 and also adding the heart rate zone APIs in 27
Replies
3
Boosts
0
Views
92
Activity
1d
Editing Apple Health Workouts
Sometimes my users would like to update an Apple Health workout after it's been saved. For example, maybe they forgot to end the workout and want to trim it. Or maybe it was a treadmill workout, and they want to add the stats from the treadmill. The way I've attempted to do this in the past is to create a new HKWorkoutBuilder, call beginCollection, and add the data the user wants to keep from the original workout (events, activities, samples, workout route, and metadata with an incremented HKMetadataKeySyncIdentifier. After all that, I call endCollection() and finishWorkout() on the builder. Is this the right way to go about it? For trimming a workout, it would be great to have a way to just duplicate a workout with an adjusted start and end time and have HealthKit do all the hard work of trimming data.
Replies
2
Boosts
0
Views
56
Activity
1d
BGHealthResearchTaskRequest beyond Health Research apps
Please could you give access to BGHealthResearchTaskRequest beyond Health Research apps. I can't see any rational why this API is restricted to Health Research apps. Without it, it is impossible to provide a decent UX based on historical data. Thanks, Stéphane FB22560687
Replies
3
Boosts
0
Views
71
Activity
1d
iOS kills the app while HKObserverQuery in background
Time to time, my app is killed in the background while handling HKObserverQuery. I always call the completion handler using a defer handler. It looks like I query a lot of data in the background. Can this be a reason for background termination, and how to handle it gracefully?
Replies
1
Boosts
1
Views
68
Activity
1d
About measuring running distance in a standard 400m playground
Everyday, when I am running on a standard 400m playground,I suffer that the distance which Apple Watch shows is always about 50m less than the standard 400m. If I run a much longer distance ,the terrible mistake nearly drives me mad. Also, the location the Apple Watch shows is often completely mistaken from the real.In China ,the playground mode still cannot be used, all aspects of the running exercises measuring give us a terrible experience.How could you deal with it and now what methods we have can avoid these problems?!!!
Replies
1
Boosts
0
Views
41
Activity
1d
Apple Health vs Siri AI
I have an app which allows users to track metrics not tracked by HealthKit. Where HealthKit is available we do sync there. I haven't had much time to play with it yet so I'm still trying to figure out the scope of what I might do, but I'm interested in adding Siri AI features to the app. I was wondering if there is any general guidance around either submitting non-HealthKit data to Siri AI. Both technical and non-technical. For example, is there any rule against submitting health data to Siri AI? And is there a recommended way to associate data with HealthKit. For example in the app body water percentage can be associated with a Body Mass entry in HealthKit.
Replies
1
Boosts
0
Views
102
Activity
1d
When will the bundle identifier parameter change in Apple Health?
Recently, I am developing an app based on user health data tracking, which involves a scenario where a user wears multiple electronic watches. In this case, I need to distinguish the data sources to prevent the data from not being correctly distinguished when the user wears multiple watches. Currently, bundle identifier seems to be a great choice for me, but after trying to read the materials, it seems that after unbinding, I rebind it. Alternatively, rebinding on another phone would cause this parameter to change. Do you have any better ideas?
Replies
1
Boosts
0
Views
45
Activity
1d
Academic research inquiry — population-scale circadian data access
I'm a biomedical researcher specializing in chronobiology and circadian time-series analysis. I'm developing cosinor-based algorithms for circadian phenotyping and chronotherapy optimization at the individual level, and I'm at the point where population-scale data would meaningfully improve model calibration. Apple Health's longitudinal passive sensor streams — particularly HRV, sleep staging, resting heart rate, and activity cadence — are well-suited to this kind of work. My question is whether Apple has an established pathway for academic researchers to access aggregate or privacy-preserving representations of Health data (e.g., via differential privacy or federated computation), and if so, what the eligibility and process look like.
Replies
2
Boosts
0
Views
71
Activity
1d
About measuring running distance in a standard 400m playground
Everyday, when I am running on a standard 400m playground,I suffer that the distance which Apple Watch shows is always about 50m less than the standard 400m. If I run a much longer distance ,the terrible mistake nearly drives me mad. Also, the location the Apple Watch shows is often completely mistaken from the real.In China ,the playground mode still cannot be used, all aspects of the running exercises measuring give us a terrible experience.How could you deal with it and now what methods we have can avoid these problems?!!!
Replies
2
Boosts
0
Views
44
Activity
1d
Checking Apple Health permissions
Is it safe to call HKHealthStore authorizationStatus() and getRequestStatusForAuthorization() on the main thread? It seems that these methods occasionally block. Any best practices for guiding a user to grant all required Apple Health permissions for a workout app? Because of privacy concerns, its difficult to know what permissions a user has granted or denied in order to guide them appropriately.
Replies
2
Boosts
1
Views
104
Activity
1d
Any Apple Health app updates this year?
Are there any updates to the Health app to be aware of that are part of the releases but weren’t mentioned in the keynote or PSTOU? The heart rate zones didn’t mention anything either, perhaps there are no changes other than that and the new menopause related data.
Replies
2
Boosts
1
Views
110
Activity
1d
Health data on iPad via iCloud
What’s the recommended way to determine whether HealthKit data is being accessed on an iPad versus an iPhone? My goal isn’t really to identify the device type itself, but to know whether the HealthKit data is likely being viewed on the device where it was originally recorded, or on a device that receives the data via HealthKit/iCloud syncing. This matters because synced HealthKit data can appear with a delay, and I’d like to set appropriate expectations for users. I previously used UITraitCollection.current.userInterfaceIdiom == .pad as a proxy for this, but that API is being deprecated. Is there a better way to distinguish between locally recorded HealthKit data and data that has arrived via sync, or otherwise identify when the app is running on an iPad?
Replies
4
Boosts
1
Views
135
Activity
1d
Medication API suggestions
Since there were not 1:1 labs available for HealthKit, I’d like to just share to the team continued interest in some feedbacks related to Medication API from last year. FB18310503 FB18310200 FB18309972 To update the post with a question, are there any medications API changes since the release in iOS 26.0? There was a short session video last summer but I haven't found anything 'new'.
Replies
3
Boosts
0
Views
68
Activity
1d
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?
Replies
1
Boosts
0
Views
64
Activity
1d
Where does ResearchKit live in the era of Liquid Glass and SwiftUI-first development?
When will ResearchKit get the needed overhaul to be fully compatible with Liquid Glass? CareKit is a SwiftUI first offering with many customization points, but ResearchKit, its older sibling, hasn’t merged the SwiftUI work. I’d like to see SwiftUI, distribution as a Swift Package, and more frequent versioned releases. Can anything be shared on the state of and plans for ResearchKit going forward? It is open source so there isn’t a good way to file feedback other than just sending to the HealthKit team. FB9558499 FB15694524 FB20292373
Replies
1
Boosts
0
Views
67
Activity
1d
Sleep Disturbances API enhancements
Since there were not 1:1 labs available for HealthKit, I’d like to just share to the team continued interest in some feedbacks related to the sleep disturbances API from last year. FB20332832 FB20330679 To make this not just a transfer of feedbacks here is a question. How can you create a sleep disturbance value on the simulator? The Health app allows you to show a sheet to create one, but the values I enter don't seem to be valid and the save button is never functional. FB20979381 - Simulator / HealthKit: The Simulator allows for launching a 'create breathing disturbances' sample but never permits saving
Replies
2
Boosts
1
Views
39
Activity
1d
Workout Activities for Interval Training Apps
Workout Activities are very useful for tracking metrics for each interval of a HIIT workout (e.g. Run/Walk or Work/Recover intervals for core body workout). However, if the workout contains lots of intervals (50 or more), I find that saving all those workout activities slow down saving the workout to Apple Health. Is this an appropriate use of workout activities? If so, it would be great to be able to set the activity type for each activity (e.g. run or walk).
Replies
1
Boosts
0
Views
44
Activity
1d
How to build better 'help the user' experiences around setting up EMR connections?
How do you suggest developers help users get their EMRs setup and connected? I don’t want to maintain custom instructions that are potentially os-version and device varying. There isn’t a way to deep link the user directly to that page, but if there was that would help me bring more products online with consuming health records, as well as making that recommendation to the user to connect — which helps all apps. FB9950311 Sorta related is the desire to deep link the user to the manage health settings page. Same thing, don’t want to maintain updating documentation I don’t control. My users need help changing their decisions and ‘go to Apple health’ isn’t great. Do you have any recommendations to Apple support articles or other ways to cleanly and simply educate users on how to manage their choices? FB13683502
Replies
1
Boosts
0
Views
50
Activity
1d