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

HealthKit Blood Pressure authorization broken on iOS 26.5 RC
Hello, I'm experiencing a bug on iOS 26.5 RC1/RC2 where the Blood Pressure option is silently excluded from the HealthKit permission dialog (when requesting HKQuantityTypeIdentifierBloodPressureSystolic and HKQuantityTypeIdentifierBloodPressureDiastolic). This does not reproduce on iOS 26.4.2 or earlier. What happens: When BP types are requested alone, a blank white modal slides up and immediately dismisses — no permission UI is shown. When BP is requested alongside other types, a normal dialog appears for those other types, but Blood Pressure is simply absent from the list. The completion handler returns success = YES, error = nil in both cases, but BP permission is never granted. The result: Settings → Privacy & Security → Health → [app] shows Blood Pressure as requested but not granted getRequestStatusForAuthorizationToShareTypes for the BP types keeps returning ShouldRequest indefinitely HealthKit queries for BP samples return no data Workaround: Manually toggling Blood Pressure to ON in Settings → Privacy & Security → Health → [app name] fixes everything - queries work, notifications fire, and getRequestStatusForAuthorizationToShareTypes correctly returns HKAuthorizationRequestStatusUnnecessary. Environment: Confirmed broken: iOS 26.5 RC1 (23F75) and RC2 (23F77), iPhone 11; iOS 26.5 RC1 (23F73), simulator Confirmed working: iOS 26.4.2 (device), iOS 26.4.1 (simulator) Feedback filed as FB22735935.
12
11
1.9k
23h
Unable to invalidate interval: no data source available error when fetching steps using HKStatisticsCollectionQuery
While attempting to read a user’s daily step history spanning backward to the last 7 days, a small but consistent subset of users encounter Error Code 3 with the underlying error description: Error Code 3 "Unable to invalidate interval: no data source available." When this error occurs, we are entirely unable to read their step history. We have received ~10 direct user reports of this within the last couple of weeks.
13
2
914
1w
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
218
1w
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
141
1w
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
144
1w
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
113
1w
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
98
1w
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
184
1w
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
92
1w
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
143
1w
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
96
1w
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
170
1w
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
192
1w
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
113
1w
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
123
1w
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
119
1w
HealthKit Blood Pressure authorization broken on iOS 26.5 RC
Hello, I'm experiencing a bug on iOS 26.5 RC1/RC2 where the Blood Pressure option is silently excluded from the HealthKit permission dialog (when requesting HKQuantityTypeIdentifierBloodPressureSystolic and HKQuantityTypeIdentifierBloodPressureDiastolic). This does not reproduce on iOS 26.4.2 or earlier. What happens: When BP types are requested alone, a blank white modal slides up and immediately dismisses — no permission UI is shown. When BP is requested alongside other types, a normal dialog appears for those other types, but Blood Pressure is simply absent from the list. The completion handler returns success = YES, error = nil in both cases, but BP permission is never granted. The result: Settings → Privacy & Security → Health → [app] shows Blood Pressure as requested but not granted getRequestStatusForAuthorizationToShareTypes for the BP types keeps returning ShouldRequest indefinitely HealthKit queries for BP samples return no data Workaround: Manually toggling Blood Pressure to ON in Settings → Privacy & Security → Health → [app name] fixes everything - queries work, notifications fire, and getRequestStatusForAuthorizationToShareTypes correctly returns HKAuthorizationRequestStatusUnnecessary. Environment: Confirmed broken: iOS 26.5 RC1 (23F75) and RC2 (23F77), iPhone 11; iOS 26.5 RC1 (23F73), simulator Confirmed working: iOS 26.4.2 (device), iOS 26.4.1 (simulator) Feedback filed as FB22735935.
Replies
12
Boosts
11
Views
1.9k
Activity
23h
Unable to invalidate interval: no data source available error when fetching steps using HKStatisticsCollectionQuery
While attempting to read a user’s daily step history spanning backward to the last 7 days, a small but consistent subset of users encounter Error Code 3 with the underlying error description: Error Code 3 "Unable to invalidate interval: no data source available." When this error occurs, we are entirely unable to read their step history. We have received ~10 direct user reports of this within the last couple of weeks.
Replies
13
Boosts
2
Views
914
Activity
1w
Detecting user wakeup from Apple WatchOS 27
Does Apple WatchOS 27 support my iOS 27 app being notified when the user wakes up?
Replies
1
Boosts
0
Views
174
Activity
1w
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
218
Activity
1w
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
141
Activity
1w
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
144
Activity
1w
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
113
Activity
1w
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
128
Activity
1w
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
128
Activity
1w
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
98
Activity
1w
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
184
Activity
1w
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
92
Activity
1w
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
143
Activity
1w
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
96
Activity
1w
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
170
Activity
1w
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
172
Activity
1w
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
192
Activity
1w
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
113
Activity
1w
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
123
Activity
1w
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
119
Activity
1w