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

Unable to read HealthKit data on watchos26 while app is in the background
Hello, My watchOS app has been performing fine by requesting background app refresh and then requesting any new data from health kit in the background so that the widget can be updated. However, on watchos26 I have been unable to read data in the background, with any query returning zero results. That same data is clearly read just fine while in the foreground. Can anyone assist?
1
0
80
1d
HKObserverQuery and BackgroundDelivery Are Highly Unstable on watchOS 26
We are developing a health app that relies on HKObserverQuery and BackgroundDelivery to monitor Heart Rate data. On watchOS 10.6 and 11.6 , these data updates are typically delivered reliably every 8–12 minutes, occasionally exceeding 12 minutes, but generally not longer than 15 minutes. This frequency has been sufficient for the real-time data requirements of our app. However, after adapting our app to watchOS 26, we noticed that HKObserverQuery triggers much less frequently, with longer and very inconsistent intervals. This issue has had a major impact on our product: data collection for essential features is unreliable, resulting in a greatly diminished user experience on watchOS 26 and making the app essentially useless from the user’s perspective. Observed Behavior: HKObserverQuery and BackgroundDelivery are extremely unstable, with trigger intervals frequently exceeding 15 minutes, and sometimes even 20 minutes. When the user is sedentary, intervals become even longer; there are cases where no heart rate or active energy updates are delivered for 30 minutes, or even over 1 hour. Request for Support and Guidance: Have there been any changes to the HKObserverQuery background delivery mechanism on watchOS 26, specifically for Heart Rate and Active Energy data? If these changes are intentional system optimizations, could you provide guidance or recommended practices to ensure our app can reliably retrieve updates and maintain a smooth experience for users? Thank you for your support.
2
0
116
1d
Apple Watch Ultra exercise app and activity rings won’t connect after charging
Since upgrading to iOS 26 beta on my Apple Watch Ultra and iPhone 16 Pro Max, my exercise app and activity rings have sporadically not connected after charging. Several recent mornings, when I’ve put my watch on, the activity rings are grayed out and when I click on them, they will show no activity, even though I have been active. Similarly, when I attempt to select the activity app, it will open, but when I select an activity, it will not start the workout. I’ve tried starting and restarting the watch and phone. I’ve checked permissions, and both the watch and phone are running the latest iOS. The only fix seems to be unpairing and repairing the watch and phone which is an absolute pain. Any assistance on how to permanently fix this would be greatly appreciated.
3
0
102
2d
Feature Request: Expand HealthKit Body Composition Data Types to Support Smart Body Scanning Scales
Summary: Expanding HealthKit to support the full spectrum of smart scale metrics will allow Apple Health to remain the central hub for health data, align with user expectations, and future-proof the framework as body composition analysis evolves. Description: With the growing adoption of smart body composition scales (e.g. segmental impedance scanners, multi-frequency analyzers, and body pods), users are generating a wide variety of clinically relevant metrics that currently cannot be stored natively in HealthKit. At present, HealthKit supports a core set of body composition values (Body Mass, BMI, Body Fat %, Lean Mass, Height, Waist Circumference). While useful, these do not capture the full picture modern devices provide, leading to fragmentation: • Users can see dozens of metrics in the device app, but only a handful flow into Health. • Developers must resort to metadata fields, which are inconsistent across apps and not accessible in Apple’s Health app UI. This gap undermines HealthKit’s role as a central, standardized health record. ⸻ Proposed Additions: Expand HealthKit HKQuantityTypeIdentifier to include additional body composition and derived measurements commonly reported by smart scales: Core Body Composition • Visceral fat percentage / rating • Skeletal muscle mass • Segmental muscle mass (arms, legs, trunk) • Segmental fat mass (arms, legs, trunk) • Bone mineral mass • Total body water % / hydration Derived Health Metrics • Muscle-to-fat ratio • Phase angle (bioelectrical impedance) • Metabolic age • Basal metabolic rate (BMR) ⸻ Rationale: • User benefit: Health app would show a more complete health profile, not just weight and fat %. • Developer benefit: Creates standardized identifiers, eliminating the need for proprietary storage in metadata. • Industry alignment: Many leading health devices already provide these metrics; users expect them to sync into Health. • Future-proofing: As body scanning scales proliferate, HealthKit can remain the trusted central repository rather than ceding ground to siloed vendor apps. ⸻ Suggested Implementation: • Introduce new HKQuantityTypeIdentifier values for each metric. • Permit segmental values to be represented as discrete samples with metadata for body region. • Ensure values can be written by apps/devices and surfaced in Health app UI, just like existing body composition data.
1
0
60
5d
watchOS: CoreMotion data, Watch goes to sleep and disconnects during tests
Hello, I am working on a Iphone app and companion Watch app that prompts the user to go through a few activities like walk, sit, etc and collects the CoreMotion data from the Watch. The phone app coordinates the actions and sends a command to the watch to start/stop the measurement. My problem is that the Watch keeps on disconnecting after a few seconds and that is messing up the data collection. Is there a way to keep the watch awake and not sleep during the duration of these tests? I also used a HealthKit session to try and keep the watch awake and measuring.. but none of these methods are reliable.. Can you please suggest how to keep the watch and phone connected and awake during the data collection? (The whole test takes about 4-5 minutes).. I have spent many days on this problem.
1
0
32
6d
How to accurately query HKWorkout segment data
Hello, In my application, I need to obtain precise workout segment data from HKWorkout in order to calculate per-kilometer metrics such as heart rate and pace. My current approach is: 1.Use HKWorkout to fetch the associated HKWorkoutEvents. 2.Take the end time of one event as the start time of the next event to derive per-kilometer segment ranges. The issue I’m facing: •If a user sets Apple Watch to notify every 5 kilometers, then at 5 km, 10 km, 15 km, etc., I see overlapping event times. •From the HKWorkoutEvents data alone, I cannot distinguish between events that represent “per-kilometer splits” and those that represent “5-kilometer notifications.” •As a result, my per-kilometer heart rate and pace calculations can be inaccurate. My question is: Is there a recommended way to reliably differentiate per-kilometer splits from custom distance notifications and ensure accurate segment data retrieval? For example, should I instead reconstruct segments using HKWorkoutRoute and distance samples, rather than relying on HKWorkoutEvents? STEPS TO REPRODUCE 1.On Apple Watch, start an Outdoor Run using the Workout app. 2.In workout notifications, set distance alerts to every 5 kilometers. 3.During the run, when reaching 5 km, 10 km, 15 km, etc., the watch triggers notifications. 4.Query the corresponding HKWorkout from HealthKit and inspect its HKWorkoutEvents. 5.Notice that some event start times are duplicated, and it is unclear which events represent “per-kilometer splits” and which represent “5-kilometer notifications.” Expected Result: Be able to differentiate between per-kilometer splits and custom distance alerts, so that heart rate and pace per kilometer can be calculated accurately. Actual Result: The HKWorkoutEvents data contains duplicated event times without a way to distinguish event types, leading to inaccurate per-kilometer statistics.
3
0
96
6d
HKObserverQuery stops delivering updates in background on watchOS 26
Hello, I’m building a health-related app for both watchOS and iOS, which needs to monitor certain health data (e.g., heart rate, active energy). Before updating to watchOS 26, the queries worked reliably without any issues. However, after adapting to watchOS 26, some users have reported that health data updates stop being delivered. What I’ve observed: HKObserverQuery with enableBackgroundDelivery is set up normally. On WatchOS 26, the query sometimes stops delivering updates entirely after a certain point, and once an update is missed, it may stop delivering further updates completely. Restarting the Apple Watch temporarily restores delivery, but the problem reoccurs after some time. This makes background health data monitoring unreliable for my app. Here’s a simplified version of the code we are using: guard let heartType = HKObjectType.quantityType(forIdentifier: .heartRate) else { return } let query = HKObserverQuery(sampleType: heartType, predicate: nil) { query, completionHandler, error in if let error = error { logEvent("Observer error: \(error.localizedDescription)") return } logEvent("Heart rate changed") MyNotificationManager.shared.sendNotification() // Send a local notification completionHandler() } healthStore.execute(query) healthStore.enableBackgroundDelivery(for: heartType, frequency: .hourly) { success, error in if success { logEvent("Background heart rate delivery enabled") } else { logEvent("Failed to enable background heart rate delivery: \(error?.localizedDescription ?? "Unknown error")") } } Could you please clarify: Is this a known issue with HKObserverQuery and enableBackgroundDelivery on watchOS 26? Are there any recommended workarounds or best practices to ensure continuous background delivery of health data? Thank you in advance for your help.
4
1
211
1w
Guidance / Documentation on iOS 18.6.1 Blood Oxygen Saturation
Are there any HealthKit related changes to be aware of in the new update that enables SPO2 / Blood Oxygen Saturation measurements on certain Apple Watch models within the US? I’m aware of processing happening on the phone…. But beyond that: Does this mean values are then saved to Apple Health? Do these models still take background SPO2 measurements in the same way as other models do? Are these values then visible in third party iOS apps as normal through HealthKit? Do these values sync back to the paired Apple Watch HealthKit store for third party apps to access on the Watch? For reference I have an iOS and WatchOS app that, amongst other features, provides the ability to see your SPO2 values in the Watch app, complications and in the iOS app.
7
0
212
1w
What’s the expected frequency of HealthKit enableBackgroundDelivery: HKCategoryTypeIdentifier.sleepAnalysis
Hello, I have enabled HealthKit background delivery for sleep analysis samples: private func setupSleepDataBackgroundDelivery() { if let sleepType = HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.sleepAnalysis) { healthStore.enableBackgroundDelivery(for: sleepType, frequency: .immediate) { (success, error) in } } } In general, this function works. But I would love to know what the limitations / expected delivery delay for frequency: .immediate is. The documentation is only very vague about this and specifies that some sample types such as steps are only delivered once per hour. But how about sleep data? Is this expected to be delivered immediately once available on iPhone? Thanks a lot for your help!
2
2
201
2w
Sleep Score API access
New in iOS 26 and WatchOS 26 is a Sleep Score calculation for users based on Duration, Bedtime and Interruptions. Unfortunately I can't find any APIs for developers to tap into this metric. Yes, in theory it's all created off the same Sleep Analysis data already available with HealthKit but that makes it very hard to recreate in our apps. If the numbers don't match up exactly, users will understandably complain. Can anyone confirm that this is the case and I've not missed a Sleep Score API? I'll then file feedback. Hopefully this doesn't go the way of Heart Rate Zones where the Apple Watch iPhone app has generated them for years and provided no way for third party apps to access these values (yes many feedbacks provided previously).
3
1
181
2w
HealthKit on macOS
HealthKit is currently not supported on macOS nor tvOS, despite being supported by visionOS. Support for macOS was last asked about[1] here in 2018. My goal is to display interactive data visualisations over workouts collected in HealthKit on macOS. Will this be possible to do in the near future using HealthKit directly? If not, can I somehow read the information from an iPhone and display it on the mac? Cheers, Rodrigo [1] https://developer.apple.com/forums/thread/94937
2
0
275
2w
What determines which suggested apps are listed in Health?
Hello - I'm wondering about the suggested apps listed by Apple in their Health app. For example, if you select the "Sleep" category there are a bunch of suggested apps like AutoSleep and Sleepzy. These are not Sleep apps that I installed on my own phone or ever shared sleep data with. Is there a way to request to have a relevant app shown there? Or is it more automatic, like you're an app that integrates with HealthKit in certain ways and Apple has a way of determining that app is suitable for the user (ex. App Store popularity, user behavior, etc.)
1
0
95
3w
Old HealthKit samples from WatchOS getting deleted and recreated years later
I have recently come across a couple of odd HealthKit step samples from WatchOS. They represent step data measured in 2022 by my Apple Watch, but they have a creation date ("Date Added to Health") within the past couple of days. These odd samples show a "View All Quantities" button at the bottom of the sample Details page in the Health app on iOS 26 (which I've never seen before); the button leads to a list of many small step quantities, almost as if some older, smaller samples were consolidated into these newer samples. Even weirder is that at least some of these samples seem to be getting re-created repeatedly. For example, I've seen the same sample with a "Date Added to Health" of 9/5/25, then 9/8/25, twice on 9/9/25, and twice on 9/10/25. These samples were originally created by WatchOS 9, and are not being deleted/recreated by any apps on my device. I have only observed it since I updated to the iOS 26 beta (and now the RC); my watch was still running iOS 18 the first time it happened, but it has also happened since my watch was updated to WatchOS 26 beta. I did some debug printing of the odd samples and the normal samples surrounding them for comparison. Here's a normal sample: Sample: 80AC5AC5-CBD7-4581-B275-0C2ACA35B7B4 6 count 80AC5AC5-CBD7-4581-B275-0C2ACA35B7B4, (9.0), "Watch6,1" (9.0) "Apple Watch" (2022-09-15 16:20:14 -0500 - 2022-09-15 16:20:16 -0500) Device: <<HKDevice: 0x10591eee0>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:Watch6,1, operatingSystemVersion:9.0> Source: <HKSource:0x110588690 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2022-09-15 21:20:16 +0000 Days between end and add: 0 And here's one of the odd samples: Sample: 4982487F-1189-4F16-AB00-61E37818A66D 676 count 4982487F-1189-4F16-AB00-61E37818A66D, (9.0), "iPhone12,1" (16.2) "Apple Watch" metadata: { HKMetadataKeySyncIdentifier = "6:38082859-D9C8-466A-8882-53443B2A2D94:684969619.25569:684970205.31182:119"; HKMetadataKeySyncVersion = 1; } (2022-09-15 16:20:19 -0500 - 2022-09-15 16:30:05 -0500) Device: <<HKDevice: 0x10591ce40>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:iPhone12,1, operatingSystemVersion:16.2> Source: <HKSource:0x110588640 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2025-09-08 21:11:12 +0000 Days between end and add: 1088 Here's that same odd sample a day later, apparently recreated: Sample: 9E8B12FC-048D-4ECD-BE5B-D387AADE5130 676 count 9E8B12FC-048D-4ECD-BE5B-D387AADE5130, (9.0), "iPhone12,1" (16.2) "Apple Watch" metadata: { HKMetadataKeySyncIdentifier = "6:38082859-D9C8-466A-8882-53443B2A2D94:684969619.25569:684970205.31182:119"; HKMetadataKeySyncVersion = 1; } (2022-09-15 16:20:19 -0500 - 2022-09-15 16:30:05 -0500) Device: <<HKDevice: 0x12f01c4e0>, name:Apple Watch, manufacturer:Apple Inc., model:Watch, hardware:Watch6,1, software:9.0, creation date:2022-08-25 18:22:26 +0000> Source revision: <HKSourceRevision name:My Apple Watch, bundle:com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, version:9.0, productType:iPhone12,1, operatingSystemVersion:16.2> Source: <HKSource:0x12f0f8230 "My Apple Watch", bundle identifier: com.apple.health.EE83959D-D009-4BA0-83A5-2E5A1CC05FE6, localDeviceSource: 0, modification date: 2024-01-31 05:49:18 +0000> Date added: 2025-09-09 20:53:18 +0000 Days between end and add: 1089 It's worth pointing out some differences between the "normal" and "odd" samples (besides the "View All Quantities" button in the Health app). The recreated "odd" samples have a different Source Revision - the "productType" and "operatingSystemVersion" refer to my iPhone, not the Apple Watch device that actually captured the samples. The odd samples also have metadata keys that don't exist in the other samples - HKMetadataKeySyncIdentifier and HKMetadataKeySyncVersion. Questions I'm hoping someone can help with: What are these samples? Why/how do they have a "View All Quantities" button that shows sub-samples? Is this new to iOS 26? Why are some of the samples getting recreated multiple times?
2
0
106
4w
Extremely persistent HealthKit read permissions issue
Overview of Issue My implementation of HealthKit is no longer able to read values due to authorization issues (ex. "HealthKitService: Not authorized to read HKQuantityTypeIdentifierHeight. Status: 0"). I have been through every conceivable debugging step including building a minimal project that just requests HealthKit data and the issue has persisted. I've tried my personal as well as Organizational developer teams. My MacOS and Mac Mini. Simulator and personal device. Rechecked entitlements, reprovisioned certificates. This makes no sense. And I have been unable to find anything similar in the Developer forums or documentation. The problem occurs during the onboarding flow when the app requests HealthKit permissions. Even when the user grants permission in the HealthKit authorization sheet, the authorizationStatus for characteristic data types (like Biological s3x and Date of Birth) and quantity data types (like Height and Weight) consistently returns as .sharingDenied. This prevents the app from pre-filling the user's profile with their HealthKit data, forcing them to enter it manually. The issue seems to be environmental rather than a specific code bug, as it has been reproduced in a minimal test case app and persists despite extensive troubleshooting. Minimal test project: https://github.com/ChristopherJones72521/HealthKitTestApp** STEPS TO REPRODUCE Build app, attempt to sign in. No data is imported into the respective fields in the main app. Console logs confirm. PLATFORM AND VERSION iOS Development environment: Xcode Version 16.4 (16F6), macOS 15.5 (24F74) Run-time configuration: iOS 18.5 Relevant Code Snippets Here are the key pieces of code that illustrate the implementation and the problem: 1. Requesting HealthKit Permissions (HealthKitService.swift) This function is called to request authorization for the required HealthKit data types. The typesToRead and typesToWrite are defined in a centralized HealthKitTypes struct. // HealthKitService.swift func requestPermissions(completion: @escaping (Bool, Error?) -&gt; Void) { guard HKHealthStore.isHealthDataAvailable() else { completion(false, HealthKitError.notAvailable) return } let typesToRead: Set&lt;HKObjectType&gt; = [ HKObjectType.characteristicType(forIdentifier: .dateOfBirth)!, HKObjectType.characteristicType(forIdentifier: .biologicals3x)!, HKObjectType.quantityType(forIdentifier: .height)!, HKObjectType.quantityType(forIdentifier: .bodyMass)! ] let typesToWrite: Set&lt;HKSampleType&gt; = [ HKObjectType.workoutType(), HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)! ] healthStore.requestAuthorization(toShare: typesToWrite, read: typesToRead) { success, error in DispatchQueue.main.async { if let error = error { print("HealthKitService: Error requesting authorization: \(error.localizedDescription)") completion(false, error) } else { print("HealthKitService: Authorization request completed. Success: \(success)") completion(success, nil) } } } } 2. Reading Biological s3x (HealthKitService.swift) This function attempts to read the user's biological s3x. The print statements are included to show the authorization status check, which is where the issue is observed. // HealthKitService.swift func readBiologicals3x() async throws -&gt; HKBiologicals3xObject? { guard HKHealthStore.isHealthDataAvailable() else { throw HealthKitError.notAvailable } let s3xAuthStatus = healthStore.authorizationStatus(for: HKObjectType.characteristicType(forIdentifier: .biologicals3x)!) print("HealthKitService: Auth status for Biological s3x: \(s3xAuthStatus.rawValue)") guard s3xAuthStatus == .sharingAuthorized else { print("HealthKitService: Not authorized to read Biological s3x.") throw HealthKitError.notAuthorized } do { return try healthStore.biologicals3x() } catch { print("HealthKitService: Error executing biologicals3x query: \(error.localizedDescription)") throw HealthKitError.queryFailed(error) } } 3. Calling HealthKit Functions During Onboarding (OnboardingFlowView.swift) This is how the HealthKitService is used within the onboarding flow. The requestHealthKitAndPrefillData function is called after the user signs in, and it attempts to read the data to pre-fill the profile form. // OnboardingFlowView.swift func readHealthKitDataAsync() async { print("Attempting to read HealthKit data async...") // ... (calls to HealthKitService.shared.readDateOfBirth(), readHeight(), etc.) do { if let biologicals3xObject = try await HealthKitService.shared.readBiologicals3x() { if self.selectedGender == nil { switch biologicals3xObject.biologicals3x { case .female: self.selectedGender = .female case .male: self.selectedGender = .male case .other: self.selectedGender = .other default: break } } } } catch { print("OnboardingFlowView: Error reading Biological s3x: (error.localizedDescription)") } print("OnboardingFlowView: Finished HealthKit data processing.") } Console Logs Attempting to read HealthKit data async... HealthKitService: Reading Date of Birth... HealthKitService: Current auth status for DOB (during read attempt): 0 HealthKitService: Not authorized to read Date of Birth. Status: 0 OnboardingFlowView: Error reading Date of Birth: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.) HealthKitService: Reading Height... HealthKitService: Current auth status for HKQuantityTypeIdentifierHeight (during read attempt): 0 HealthKitService: Not authorized to read HKQuantityTypeIdentifierHeight. Status: 0 OnboardingFlowView: Error reading Height: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.) HealthKitService: Reading Weight (Body Mass)... HealthKitService: Current auth status for HKQuantityTypeIdentifierBodyMass (during read attempt): 0 HealthKitService: Not authorized to read HKQuantityTypeIdentifierBodyMass. Status: 0 OnboardingFlowView: Error reading Weight: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.) HealthKitService: Pre-read check for Biologicals3x auth status: 1 (Denied) HealthKitService: Reading Biological s3x... HealthKitService: Current auth status for Biological s3x (during read attempt): 1 HealthKitService: Not authorized to read Biological s3x. Status: 1 OnboardingFlowView: Error reading Biological s3x: The operation couldn’t be completed. (Strike_Force.HealthKitError error 2.)
2
0
195
Sep ’25
Best Practices for Continuous Background Biometric Monitoring on Apple Watch
Hello, everyone! I'm seeking some guidance on the App Store review process and technical best practices for a watchOS app. My goal is to create an app that uses HealthKit to continuously monitor a user's heart rate in the background for sessions lasting between 30 minutes and 3 hours. This app would not be a fitness or workout tracker. My primary question is about the best way to achieve this reliably while staying within the App Store Review Guidelines. Is it advisable to use the WorkoutKit framework to start a custom, non-fitness "session" for the purpose of continuous background monitoring? Are there any other recommended APIs or frameworks for this kind of background data collection on watchOS that I should be aware of? What are the key review considerations I should be mindful of, particularly regarding Guideline 4.1 (Design) and the intended use of APIs? My app's core functionality would require this kind of data for a beneficial purpose. I want to ensure my approach is technically sound and has the best chance of a successful review. Any insights or advice from developers who have experience with similar use cases would be incredibly helpful! Thank you!
1
0
275
Aug ’25
Is it possible to get Workout intervals and data from third party app via HealthKit or WorkoutKit?
If a user selects custom structured workout in the apple watch Workout app and records a run with intervals, how can my third party app pull in that data? I can obviously get the workout and health stuff like heart rate, but I cannot find how to save the intervals and the relevant data. The workout events are not seemingly helpful - segments are not obviously related to this. Is it possible? Is it only possible to have the third party app create a customworkout with metadata and then our third party app parses the interval distance/time based on our own structure? I think this stuff should be able to be accessed.
0
0
204
Aug ’25
AppIntent, StartWorkoutIntent, and Siri
I'm a bit confused as to what we're supposed to be doing to support starting a workout using Siri in iOS/watchOS 26. On one hand, I see a big push to move towards App Intents and shortcuts rather than SiriKit. On the other hand, I see that some of the things I would expect to work with App Intents well... don't work. BUT - I'm also not sure it isn't just developer error on my part. Here are some assertions that I'm hoping someone more skilled and knowledgable can correct me on: Currently the StartWorkoutIntent only serves the Action button on the Watch Ultra. It cannot be used to register Shortcuts, nor does Siri respond to it. I can use objects inherited from AppIntent to create shortcuts, but this requires an additional permission to run a shortcut if a user starts a workout with Siri. AppIntent shortcuts requires the user to say "Start a workout in " - if the user leaves out the "in " part, Siri will not prompt the user to select my app. If I want to allow the user to simply say "Start a Workout" and have Siri prompt the user for input as to which app it should use, I must currently use the older SiriKit to do so. Are these assertions correct - or am I just implementing something incorrectly? Using the latest Xcode 26 beta for what it is worth.
1
1
115
Aug ’25
HealthKit Background Delivery and URLSession.shared.dataTask
Hello. I have implemented background delivery for detecting changes in health kit with HKObserverQuery. It works well, I am reading changes. And I am sending this changes to an https endpoint with using an URLSession.shared.dataTask inside the HKObserverQuery callback while my app is terminated. I have several questions about this: Is starting a URLSession.shared.dataTask inside HKObserverQuery callback when app is terminated is correct way to do it? I am calling HKObserverQuery completion handler whatever dataTask returned success or failure but I am wondering what if the network connection is low and this dataTask response could not received in 2-3 seconds. I have read background deliveries should take 1-2 seconds. Should I use an URL session with background configuration for sending those HTTPS requests? If so, should I use download task or upload task (they don't fit my requirements I am sending a simple json)?
2
0
101
Aug ’25