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

Why does a watchOS HKLiveWorkoutBuilder soccer workout report shorter totalDistance than Apple Workout soccer?
I’m developing a watchOS app that records outdoor soccer workouts using HealthKit. My app starts a workout session with: HKWorkoutConfiguration.activityType = .soccer HKWorkoutConfiguration.locationType = .outdoor HKWorkoutSession HKLiveWorkoutBuilder HKLiveWorkoutDataSource During the workout, I display distance from the live builder statistics: HKQuantityType.quantityType(forIdentifier: .distanceWalkingRunning) After the workout ends, I save the workout using finishWorkout(), and later read the saved distance from: HKWorkout.totalDistance?.doubleValue(for: .meter()) So the total distance shown in my app is not calculated manually from GPS route points. It comes from HealthKit’s workout distance. I noticed a difference between soccer workouts recorded by Apple’s built-in Workout app and soccer workouts recorded by my third-party watchOS app. Example comparison: Apple Workout app soccer: Active duration: about 88 min Steps: about 8,832 Distance: about 6.7 km No visible route/location data in Fitness My watchOS app soccer: Active duration: about 87 min Steps: about 8,998 Distance: about 5.6 km Includes route/location data Workout recorded through HKWorkoutSession + HKLiveWorkoutBuilder Distance read from HKWorkout.totalDistance The step counts and active durations are very close, but the distance differs by about 1.1 km. One important detail is that the Apple Workout app soccer workout does not appear to include visible route/location data in Fitness, while my third-party workout does include route/location data. Despite that, the Apple Workout app reports a longer distance. So the comparison is not simply “GPS route distance vs GPS route distance”. It looks like the built-in Workout app may be estimating soccer distance without exposing route data, while HKLiveWorkoutBuilder for a third-party .soccer workout may be producing a different totalDistance estimate. My questions are: When the built-in Apple Workout app records an outdoor soccer workout without exposing route data, how is totalDistance estimated? Is that distance estimation behavior available to third-party watchOS apps using HKWorkoutSession + HKLiveWorkoutBuilder with .soccer? If a third-party app records route data for the same soccer activity, can that change how HealthKit calculates totalDistance compared with a no-route built-in Workout app recording? For third-party soccer workouts, should developers expect HKWorkout.totalDistance to match the built-in Workout app, or is a difference expected? Is there any additional configuration, entitlement, data type, or best practice required to get more accurate distance estimates for soccer workouts? Any clarification on the expected behavior would be very helpful. Thanks!
0
1
40
1d
WorkoutKit Feature Request: Distance & Time based IntervalBlock
Today, IntervalBlock only supports a fixed iteration count: IntervalBlock(steps: [IntervalStep], iterations: Int) This works well when the athlete knows exactly how many rounds they want to perform, but a lot of structured running and cycling workouts terminate a repeating block based on cumulative distance or cumulative elapsed time instead. These constructs are first-class on Garmin Connect, TrainingPeaks, FinalSurge, and similar platforms, but there's no way to express them in WorkoutKit's CustomWorkout. We've had to either fall back to a fixed iteration count (which forces us to guess the user's pace) or skip Apple Workout scheduling for these workouts entirely, which is a poor experience for athletes on watchOS. Proposal: // Today (still supported) IntervalBlock(steps: steps, iterations: 5) // Proposed IntervalBlock(steps: steps, until: .distance(5, .kilometers)) IntervalBlock(steps: steps, until: .time(30, .minutes)) IntervalBlock(steps: steps, iterations: 8) // unchanged Example Workouts with proposed features: "Run/walk until 5 km" Run for a minute, then walk for 30 seconds until completing a 5K. "30-minute fartlek" Repeat a hard/easy pair until cumulative time hits 30 min "10 km tempo with surges" Surge/recover until total distance hits 10 km. FB: FB23359408
0
0
52
3d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) (Device iPhone 17 Pro Max - Apple Watch Series 9) Any more suggestions on how to fix this? Thanks everybody!
5
0
70
3d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) Any more suggestions on how to fix this? Thanks everybody!
0
0
44
4d
HealthKit multiple queries performance questions
We're building two apps that rely almost exclusively on HealthKit, so we run a high volume of queries against a single shared HKHealthStore — mostly HKSampleQuery, plus HKStatisticsQuery and HKQuantitySeriesSampleQuery where needed. We also use HKObserverQuery for background processing and widget updates. The data is sleep, body metrics, and workouts. As our feature set grew, so did data-loading time, to the point of being a noticeable annoyance for users. To speed things up we moved from serial to concurrent queries. Mechanism: we issue the batch via a ThrowingTaskGroup — each child task calls execute() and awaits the completion handler through a continuation — with up to ~30 queries in flight concurrently against the one shared store. Symptom: The app doesn't freeze and the queries start fine, but their results sometimes take 30s+ to come back. Most of the times the same data fetch takes only a couple of seconds. There's no clear pattern except that it happens far more often on foregrounding. Environment: Devices we use for testing are iPhone 17 Pro and iPhone 15 pro both running iOS 26.5. Since the symptoms are hard to catch we're using text file logging to time the data layer responses. We're considering bounding concurrency to a small N via a capped task group, or reverting to serial — but both feel like either a regression or added complexity we can't justify without understanding the real cause. Questions: When we start ~30 queries at once against a single HKHealthStore, does HealthKit actually run them in parallel, or do they get handled one-at-a-time (or rate-limited) behind the scenes? Is there a sensible upper limit on how many queries we should run at once? Should we cap it to a small number, or does that not help because the system serializes them anyway? (Also: is sharing one HKHealthStore across the app the right approach?) Why would this happen mainly when the app comes to the foreground? A few possibilities we'd like confirmed or ruled out: the device hasn't been unlocked yet so health data isn't available, the connection to the HealthKit service is being re-established after backgrounding, general contention, or our background HKObserverQuery work blocking the foreground queries. Can HKObserverQuery background work get in the way of foreground queries? If so, is there a recommended way to pause or coordinate it when the app becomes active? Thank you
0
0
58
4d
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
2.1k
5d
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
993
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
257
2w
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
189
2w
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
200
2w
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
150
2w
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
145
2w
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
240
2w
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
142
2w
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
183
2w
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
137
2w
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
218
2w
Why does a watchOS HKLiveWorkoutBuilder soccer workout report shorter totalDistance than Apple Workout soccer?
I’m developing a watchOS app that records outdoor soccer workouts using HealthKit. My app starts a workout session with: HKWorkoutConfiguration.activityType = .soccer HKWorkoutConfiguration.locationType = .outdoor HKWorkoutSession HKLiveWorkoutBuilder HKLiveWorkoutDataSource During the workout, I display distance from the live builder statistics: HKQuantityType.quantityType(forIdentifier: .distanceWalkingRunning) After the workout ends, I save the workout using finishWorkout(), and later read the saved distance from: HKWorkout.totalDistance?.doubleValue(for: .meter()) So the total distance shown in my app is not calculated manually from GPS route points. It comes from HealthKit’s workout distance. I noticed a difference between soccer workouts recorded by Apple’s built-in Workout app and soccer workouts recorded by my third-party watchOS app. Example comparison: Apple Workout app soccer: Active duration: about 88 min Steps: about 8,832 Distance: about 6.7 km No visible route/location data in Fitness My watchOS app soccer: Active duration: about 87 min Steps: about 8,998 Distance: about 5.6 km Includes route/location data Workout recorded through HKWorkoutSession + HKLiveWorkoutBuilder Distance read from HKWorkout.totalDistance The step counts and active durations are very close, but the distance differs by about 1.1 km. One important detail is that the Apple Workout app soccer workout does not appear to include visible route/location data in Fitness, while my third-party workout does include route/location data. Despite that, the Apple Workout app reports a longer distance. So the comparison is not simply “GPS route distance vs GPS route distance”. It looks like the built-in Workout app may be estimating soccer distance without exposing route data, while HKLiveWorkoutBuilder for a third-party .soccer workout may be producing a different totalDistance estimate. My questions are: When the built-in Apple Workout app records an outdoor soccer workout without exposing route data, how is totalDistance estimated? Is that distance estimation behavior available to third-party watchOS apps using HKWorkoutSession + HKLiveWorkoutBuilder with .soccer? If a third-party app records route data for the same soccer activity, can that change how HealthKit calculates totalDistance compared with a no-route built-in Workout app recording? For third-party soccer workouts, should developers expect HKWorkout.totalDistance to match the built-in Workout app, or is a difference expected? Is there any additional configuration, entitlement, data type, or best practice required to get more accurate distance estimates for soccer workouts? Any clarification on the expected behavior would be very helpful. Thanks!
Replies
0
Boosts
1
Views
40
Activity
1d
WorkoutKit Feature Request: Distance & Time based IntervalBlock
Today, IntervalBlock only supports a fixed iteration count: IntervalBlock(steps: [IntervalStep], iterations: Int) This works well when the athlete knows exactly how many rounds they want to perform, but a lot of structured running and cycling workouts terminate a repeating block based on cumulative distance or cumulative elapsed time instead. These constructs are first-class on Garmin Connect, TrainingPeaks, FinalSurge, and similar platforms, but there's no way to express them in WorkoutKit's CustomWorkout. We've had to either fall back to a fixed iteration count (which forces us to guess the user's pace) or skip Apple Workout scheduling for these workouts entirely, which is a poor experience for athletes on watchOS. Proposal: // Today (still supported) IntervalBlock(steps: steps, iterations: 5) // Proposed IntervalBlock(steps: steps, until: .distance(5, .kilometers)) IntervalBlock(steps: steps, until: .time(30, .minutes)) IntervalBlock(steps: steps, iterations: 8) // unchanged Example Workouts with proposed features: "Run/walk until 5 km" Run for a minute, then walk for 30 seconds until completing a 5K. "30-minute fartlek" Repeat a hard/easy pair until cumulative time hits 30 min "10 km tempo with surges" Surge/recover until total distance hits 10 km. FB: FB23359408
Replies
0
Boosts
0
Views
52
Activity
3d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) (Device iPhone 17 Pro Max - Apple Watch Series 9) Any more suggestions on how to fix this? Thanks everybody!
Replies
5
Boosts
0
Views
70
Activity
3d
Apple Watch awards missing after iPhone iCloud restore
Hello forum-community I hope you're all doing well. My Iphone recently went to apple in order to fix an issue with my camera. After I received it back, I loaded a Backup from ICloud I made before the Iphone went to Apple. So far so good. The Back Up took very long to load onto the device. Especially the apps downloading took almost four hours but I was also fine with that. When the BackUp was finished I had some bugs in some apps like yazio. Some scaling issue led to the app zooming in and out every time I tried to open Yazio. Not really a big deal but it somehow it annoyed me, so I upgraded the Ios from stable 26.5.1 to public beta 26.6 . Enough context. Now my problem: There must have went something wrong while loading the backup. All my workouts from 2023-today, all monthly medals, all other fitness data can be seen in the app. Most medals in the category „workouts“ somehow did NOT sync properly so it looks like I never completed a workout at all. What I've tried so far: Restored both my iPhone and Apple Watch from backups. Verified that all workout history is present (workouts since 2023 are intact). Verified that monthly challenges are still present. Verified that Health data appears complete and correct. Verified that activity data (Move, Exercise, Stand) is present. Confirmed that workout records are correctly stored in the Fitness and Health apps. Updated the iPhone to the latest iOS beta version. Unpaired and re-paired the Apple Watch. Restored the Apple Watch from an older backup. Allowed several days (approximately 5+ days) for Fitness and Health data to resynchronize. Kept both devices connected to Wi-Fi and charging for extended periods. Confirmed that some achievements (e.g. Longest Move Streak) are displayed correctly. Confirmed that many Workout Awards are missing or shown as not earned. Confirmed that some “Close Your Rings” awards are incorrect or missing. Confirmed that awards for workouts already completed after the restore (e.g. Walking Workout, Running Workout) remain greyed out. Confirmed that newly completed qualifying workouts are recorded correctly but do not trigger the corresponding awards. Verified that the issue persists after restoring the Apple Watch from a different backup. Contacted Apple Support. Apple Support declined further troubleshooting because the iPhone is running a beta version of iOS and recommended restoring to a non-beta version (already did that - result: no fitness data at all) Any more suggestions on how to fix this? Thanks everybody!
Replies
0
Boosts
0
Views
44
Activity
4d
HealthKit multiple queries performance questions
We're building two apps that rely almost exclusively on HealthKit, so we run a high volume of queries against a single shared HKHealthStore — mostly HKSampleQuery, plus HKStatisticsQuery and HKQuantitySeriesSampleQuery where needed. We also use HKObserverQuery for background processing and widget updates. The data is sleep, body metrics, and workouts. As our feature set grew, so did data-loading time, to the point of being a noticeable annoyance for users. To speed things up we moved from serial to concurrent queries. Mechanism: we issue the batch via a ThrowingTaskGroup — each child task calls execute() and awaits the completion handler through a continuation — with up to ~30 queries in flight concurrently against the one shared store. Symptom: The app doesn't freeze and the queries start fine, but their results sometimes take 30s+ to come back. Most of the times the same data fetch takes only a couple of seconds. There's no clear pattern except that it happens far more often on foregrounding. Environment: Devices we use for testing are iPhone 17 Pro and iPhone 15 pro both running iOS 26.5. Since the symptoms are hard to catch we're using text file logging to time the data layer responses. We're considering bounding concurrency to a small N via a capped task group, or reverting to serial — but both feel like either a regression or added complexity we can't justify without understanding the real cause. Questions: When we start ~30 queries at once against a single HKHealthStore, does HealthKit actually run them in parallel, or do they get handled one-at-a-time (or rate-limited) behind the scenes? Is there a sensible upper limit on how many queries we should run at once? Should we cap it to a small number, or does that not help because the system serializes them anyway? (Also: is sharing one HKHealthStore across the app the right approach?) Why would this happen mainly when the app comes to the foreground? A few possibilities we'd like confirmed or ruled out: the device hasn't been unlocked yet so health data isn't available, the connection to the HealthKit service is being re-established after backgrounding, general contention, or our background HKObserverQuery work blocking the foreground queries. Can HKObserverQuery background work get in the way of foreground queries? If so, is there a recommended way to pause or coordinate it when the app becomes active? Thank you
Replies
0
Boosts
0
Views
58
Activity
4d
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
2.1k
Activity
5d
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
993
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
228
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
257
Activity
2w
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
189
Activity
2w
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
200
Activity
2w
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
150
Activity
2w
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
175
Activity
2w
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
180
Activity
2w
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
145
Activity
2w
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
240
Activity
2w
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
142
Activity
2w
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
183
Activity
2w
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
137
Activity
2w
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
218
Activity
2w