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?) -> Void) {
guard HKHealthStore.isHealthDataAvailable() else {
completion(false, HealthKitError.notAvailable)
return
}
let typesToRead: Set<HKObjectType> = [
HKObjectType.characteristicType(forIdentifier: .dateOfBirth)!,
HKObjectType.characteristicType(forIdentifier: .biologicals3x)!,
HKObjectType.quantityType(forIdentifier: .height)!,
HKObjectType.quantityType(forIdentifier: .bodyMass)!
]
let typesToWrite: Set<HKSampleType> = [
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 -> 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.)
HealthKit
RSS for tagAccess and share health and fitness data while maintaining the user’s privacy and control using HealthKit.
Posts under HealthKit tag
104 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
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.
According to the WWDC25 Presentation Track workouts with HealthKit on iOS and iPadOS, there is supposed to be a new property for restoring an active workout after a crash on iOS/iPadOS. The developer documentation also supports this. However, this property does not seem to exist in the latest Xcode 26 beta, even in projects targeting iOS 26.0 as the minimum version.
Am I missing something? Has this property not been made available yet? It is actually looking like all of the new iOS 26.0 properties are missing UIScene.ConnectionOptions on my system.
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.
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags:
WatchKit
Health and Fitness
watchOS
HealthKit
I'm having a problem with Xcode 26 where a symbol bug is causing my app to crash at launch if they are running iOS 17.X
This has to do with a HealthKit API that was introduced in iOS 18.1 HKQuantityType(.appleSleepingBreathingDisturbances), I use availability clauses to ensure I only support it in that version. This all worked fine with Xcode 16.4 but breaks in Xcode 26.
This means ALL my users running iOS 17 will get at launch crashes if this isn't resolved in the Xcode GM seed.
I'll post the code here in case I'm doing anything wrong. This, the HealthKit capability, the "HealthKit Privacy - Health Share Usage Description" and "Privacy - Health Update Usage Description", and device/simulator on iOS 17.X are all you need to reproduce the issue.
I've made a feedback too as I'm 95% sure it's a bug: FB19727966
import SwiftUI
import HealthKit
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
}
.padding()
.task {
print(await requestPermission())
}
}
}
#Preview {
ContentView()
}
func requestPermission() async -> Bool {
if #available(iOS 18.0, *) {
let healthTypes = [HKQuantityType(.appleSleepingBreathingDisturbances)]
var readTypes = healthTypes.map({$0})
let write: Set<HKSampleType> = []
let res: ()? = try? await HKHealthStore().requestAuthorization(toShare: write, read: Set(readTypes))
guard res != nil else {
print("requestPermission returned nil")
return false
}
return true
}
else { return false}
}
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 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 HealthKit background deliveries should take 1-2 seconds.
Should I use background task somehow for sending those HTTPS requests?
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)?
Hi guys,
We have an app that consumes data from Apple HealthKit. We use an HKObserverQuery to monitor changes in HealthKit data, and occasionally use regular HKSampleQuery requests when the app is in the foreground.
Over the past few weeks, we’ve been encountering a significant number of errors when requesting additional HealthKit permissions (beyond what the user has already granted). The error message we’re seeing is:
The operation couldn't be completed. (_UIViewServiceInterfaceErrorDomain error 2.)
When this error occurs, all previously granted HealthKit permissions are automatically revoked, which is highly disruptive.
We have a few questions and would greatly appreciate any insights or explanations regarding this behavior:
Could this error occur if a permission request is triggered right as the app moves to the background?
Why would previously granted permissions be revoked automatically after this error?
If this is due to some internal behavior in iOS (e.g., a system-level protection or timeout), is there any known workaround or best practice to prevent this from happening?
Thanks in advance for your help!
Hi everyone,
while testing HKWorkoutSession with HKLiveWorkoutBuilder on iOS 26 Beta (cycling workout), I noticed the following behavior:
– Starting a cycling HKWorkoutSession automatically connects to my Bluetooth heart rate monitor and records HR into HealthKit ✅
– However, my Bluetooth cycling power meter and cadence sensor (standard BLE Cycling Power & CSC services) are not connected automatically, and no data is recorded into HealthKit ❌
On Apple Watch, when starting a cycling workout, these sensors do connect automatically and their data is written to HealthKit — which is exactly what I would expect on iOS as well.
Question:
Is this by design, or is support for power and cadence sensors planned for iOS in the same way as on watchOS?
Or do we, as developers, need to implement the BLE Cycling Power and CSC profiles ourselves (via CoreBluetooth) if we want these metrics?
Environment:
– iOS 26 Beta
– HKWorkoutSession & HKLiveWorkoutBuilder (cycling)
– Bluetooth HRM connects automatically
– BLE power & cadence sensors do not
This feature would make it much easier to develop cycling apps with full HealthKit integration, and also create a more consistent user experience compared to watchOS.
Thanks for any insights!
Topic:
App & System Services
SubTopic:
Hardware
Tags:
Health and Fitness
HealthKit
Core Bluetooth
WorkoutKit
Looking for help with our Apple HealthKit integration. We've successfully pulled steps, distance, active energy, glucose and heart rate. However, the data pulled for sleep duration is incorrect. Not sure what we're doing wrong.
Hello,
What is the best practice for sending customized workouts to the Apple Watch.
For example, sending a running workout that entails:
Run 1 mile at 8:00/mile
Walk 2 minutes
Run 2 mile at 7:00/mile ----
Walk 2 minutes ----
Repeat 2x
Run 1 mile at 8:00/mile
Any documentation or sample codes would be amazing. Thank you
In iOS 26, HKLiveWorkoutBuilder is supported, which we can use like HKWorkoutSession in watchOS - this is very exciting.
However, it currently seems to have a bug in calculating calories.
I tested it in my app, and for nearly 6 minutes with an average heart rate of 134, it only calculated 8 calories consumed (80 calories per hour), including basal consumption, which is obviously incorrect.
(I used Powerboats Pro 2 connected to my phone, which includes heart rate data, and HKLiveWorkoutBuilder correctly collected the heart rate, which is great.)
I think my code is correct.
func workoutBuilder(_ workoutBuilder: HKLiveWorkoutBuilder, didCollectDataOf collectedTypes: Set<HKSampleType>) {
for type in collectedTypes {
guard let quantityType = type as? HKQuantityType else {
return // Nothing to do.
}
let statistics = workoutBuilder.statistics(for: quantityType)
if let statistics = statistics {
switch statistics.quantityType {
case HKQuantityType.quantityType(forIdentifier: .heartRate):
/// - Tag: SetLabel
let heartRateUnit = HKUnit.count().unitDivided(by: HKUnit.minute())
let value = statistics.mostRecentQuantity()?.doubleValue(for: heartRateUnit)
let roundedValue = Double( round( 1 * value! ) / 1 )
if let avg = statistics.averageQuantity()?.doubleValue(for: heartRateUnit) {
self.avgHeartRate = avg
}
self.delegate?.didUpdateHeartBeat(self, heartBeat: Int(roundedValue))
case HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned):
let energyUnit = HKUnit.kilocalorie()
let value = statistics.sumQuantity()?.doubleValue(for: energyUnit)
self.totalActiveEnergyBurned = Double(value!)
print("didUpdate totalActiveEnergyBurned: \(self.totalActiveEnergyBurned)")
self.delegate?.didUpdateEnergyBurned(self, totalEnergy: self.totalActiveEnergyBurned + self.totalBasalEneryBurned)
return
case HKQuantityType.quantityType(forIdentifier: .basalEnergyBurned):
let energyUnit = HKUnit.kilocalorie()
let value = statistics.sumQuantity()?.doubleValue(for: energyUnit)
self.totalBasalEneryBurned = Double(value!)
print("didUpdate totalBasalEneryBurned: \(self.totalBasalEneryBurned)")
self.delegate?.didUpdateEnergyBurned(self, totalEnergy: self.totalActiveEnergyBurned + self.totalBasalEneryBurned)
return
default:
print("unhandled quantityType=\(statistics.quantityType) when processing statistics")
return
}
}
I think I've found the source of the problem:
let workoutConfiguration = HKWorkoutConfiguration()
workoutConfiguration.activityType = .traditionalStrengthTraining //walking, running is ok
workoutConfiguration.locationType = .outdoor
When I set the activityType to walking or running, the calorie results are correct, showing several hundred calories per hour.
However, when activityType is set to traditionalStrengthTraining or jumprope, the calculations are incorrect.
PS:
I'm currently using Xcode 26 beta3 and iOS 26 beta3.
Hope this issue can be resolved. Thanks.
Has anyone had success using the HKWorkoutRouteBuilder in conjunction with the new iOS support for HKLiveWorkoutBuilder?
I was running my watchOS code that worked now brought over to iOS and when I call insertRouteData the function never returns. This happens for both the legacy and closure based block patterns.
private var workoutSession: HKWorkoutSession?
private var workoutBuilder: HKLiveWorkoutBuilder?
private var serviceSession: CLServiceSession?
private var workoutRouteBuilder: HKWorkoutRouteBuilder?
private func startRouteBuilder() {
Task { @MainActor in
self.serviceSession = CLServiceSession(authorization: .whenInUse)
self.workoutRouteBuilder = self.workoutBuilder?.seriesBuilder(for: .workoutRoute()) as? HKWorkoutRouteBuilder
self.locationUpdateTask = Task {
do {
for try await update in CLLocationUpdate.liveUpdates(.fitness) {
if let location = update.location {
self.logger.notice(#function, metadata: [
"location": .stringConvertible(location)
])
try await self.workoutRouteBuilder?.insertRouteData([location])
self.logger.notice("Added location")
}
}
} catch {
self.logger.error(#function, metadata: [
"error": .stringConvertible(error.localizedDescription)
])
}
}
}
}
I did also try CLLocationManager API with delegate which is what my current watch code uses (a bit old). Same issue.
Here is what I've found so far:
If the workout session is not running, and if the builder hasn't started collection yet, inserting route data works just fine
I've tried different swift language modes, flipped from main actor to non isolated project settings (Xcode 26)
Modified Apple's sample code and added location route building to that and reproduced the error, modified sample attached to feedback
This issue was identified against Xcode 26 beta 2 and iPhone 16 Pro simulator. Works as expected on my iPhone 13 Pro beta 2.
FB18603581 - HealthKit: HKWorkoutRouteBuilder insert call within CLLocationUpdate task never returns
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags:
Beta
Health and Fitness
HealthKit
WorkoutKit
I am very happy to see that HealthKit with OS26 is bringing HKLiveWorkoutDataSource to iOS and iPadOS. I have been replicating a similar type for the last several years for users that only have an iPhone.
I did notice that the data types that the different platform data sources collect automatically is different. That makes sense if you think exclusively about what the device can actually capture. Bluetooth HRM is the only Bluetooth SIG profile that is out-of-the-box supported for Apple Health on iOS and iPadOS (right?). Whereas watchOS 10 got all of the cycling sensors (woohoo!).
It would be great if the types to collect were the same across platforms even if the device couldn't collect the data now, because then in the future when / if new sensor support is added, it will be transparent to developers. Fantastic. Easier life as an indie / third party developer. At least that is the idea.
And yes, I know I can also write Core Bluetooth code and roll my own SIG implementation for the cycling profiles, but Apple already has this code in one os, 'just copy it, it will be easy'. I know that isn't the reality especially against the new ASK framework, but one can hope and dream right? Imagine how many more apps would contribute that data if it was supported out of the box. An alternative, GitHub is a great place for Apple to share their Core Bluetooth implementation of the SIG profiles :). Just another thought.
Here are some feedbacks related to this:
FB17931751 - HealthKit: Add built-in support for cycling sensors on iOS and iPadOS - copy paste the code from watchOS. It will be easy they said (June 2025)
FB12323089 - CoreBluetooth / Health / Bluetooth Settings: Add support for cycling sensors announced in watchOS 10 to iOS and iPadOS 17 (June 2023)
FB14311218 - HealthKit: Expected outdoor cycling to include .cyclingSpeed quantity type as a default HKLiveWorkoutDataSource type to collect (July 2024)
FB14978701 - Bluetooth / HealthKit / Fitness: Expose information about the user specified for Apple Watch paired Cycing Speed Sensor like isConnected and wheelCircumference values (August 2024)
FB18402258 - HealthKit: HKLiveWorkoutDataSource should collect same types on iOS and watchOS even if device cannot produce data today (June 2025)
FB14236080 - Developer Documentation / HealthKit: Update documentation for HKLiveWorkoutDataSource typesToCollect for which sample types are automatically collected by watchOS 10 and 11 (July 2024)
Tangentially related:
FB10281304 - HealthKit: Add HKActivityTypes canoeBikeRun and kayakBikeRun (June 2022)
FB10281349 - HealthKit: Add HKActivityType walkCanoeWalk and walkKayakWalk (June 2022)
FB7807993 - Add HKQuantityTypeIdentifier.paddleDistance for canoeing, kayaking, etc type workouts (June 2020)
FB12508654 - HealthKit / Settings / Bluetooth / Workouts: Cycling sensor support doesn't allow for 'bike selection' in use case of multiple bikes and multiple sensors (borrow a bike to ride together) - production usability issue (July 2023)
Topic:
App & System Services
SubTopic:
Health & Fitness
Tags:
Health and Fitness
HealthKit
Core Bluetooth
AccessorySetupKit
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!
The recent WWDC presentation on HealthKit demonstrated how to associate side effects with a medication dose using HKObjectType.categoryType(forIdentifier:) and HKCategorySample, a subclass of HKObject.
There also appears to be an object type specifically for medication doses: HKMedicationDoseEventType, accessible via HKObjectType.medicationDoseEventType(). However, there’s no corresponding public subclass of HKObject that supports this identifier. The most relevant class, HKMedicationDoseEvent, exists but has an inaccessible initializer.
Is there currently a supported way to use HKMedicationDoseEventType, or is this functionality not yet available?
https://developer.apple.com/videos/play/wwdc2025/321/
I'm looking to maximise my Watch app's widget to be as up to date as possible.
If we imagined the app was a simple step counter, and we wanted to display the users count as up to date as possible. We can conclude:
We don't care about widget timelines beyond the current entry as we can't predict the future!
We need to refresh the count as often as possible
The refresh should be very quick with a straightforward HealthKit query, no networking or heavy work needed.
We will assume the user has the complication/widget on their active Watch face.
With the standard WidgetKit APIs we can expire the timeline after 15 minutes and in my experimentation a Watch app can usually update its widget timeline at that frequency if it's on the Watch face.
I'm experimenting with two methods to try and improve refreshes further
A user's step count might not have recently changed when the timeline update is called. I was therefore looking into the HealthKit enableBackgroundDelivery API (which requires the HealthKit Background Delivery entitlement to be enabled) to get updates limited to once an hour from a HKObserverQuery, I can then call the WidgetCenter.shared.reloadAllTimelines() from there.
WatchOS also support the BGAppRefreshTaskRequest(identifier:"") and .backgroundTask(.appRefresh) APIs. I can request updates once every 15 minutes here too and then call the WidgetCenter.shared.reloadAllTimelines().
With option 1, this update opportunity is great as it will specifically update when there's new steps so even once an hour this would be helpful (A real shame to be limited to once an hour even if this used up WidgetKit standard reload budgets: FB13879817, FB11677132, FB10016177). But I can't determine if this update takes away one of the standard timeline expiration updates that already run 4 times an hour? Could I observe additional Health types to get additional updates? Do I need the Background Modes Capability as well as the HealthKit Background Delivery for this in Xcode or just the HealthKit one?
With option 2, I can't find a suitable option in the (short) list of supported background modes in Xcode. Does not selecting any mean my app will get 0 refreshes from this route and so should not be implemented in my use case?
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
WatchKit
HealthKit
WidgetKit
Background Tasks
This is probably a basic question but I wanted to ask your advice for the best way to take consenting users' Watch data from Apple Health Kit and send it to our central server? One idea we had was to create an iOS app that gets the data from Apple's Health SDK on the phone and sends it to our server. Would appreciate any help here, thank you.
I have a Health & Fitness widget that runs on iPhone and Apple Watch. As Health data access requires the device to be unlocked, the iPhone widget is already slightly limited in capability because of updates.
With widgets further expanding to places like CarPlay, I know I can use the .disfavouredLocations{} API to try and prevent it being offered there. This is crucial as the widget functionality would be basically non-existent as your device is locked during CarPlay use.
My problem is, on the Mac despite using the .disfavouredLocations{.iPhoneWidgetsOnMac} etc...., the widget can still be added in the "other unsupported section". And yet, in that section the Apple Fitness app widget is no where to be seen. Is there an API I am missing to completely remove a widget from the Mac widget gallery and hopefully CarPlay, Standby etc.... (all places where the device running the widget is usually locked -> No Health data)?
Or does the Apple Fitness app have a private API to block it from these places where its function is not wanted and this isn't available to other apps?
When I set the distanceFilter = 5 (5 meters) in the GPS CLLocationManager
I can't display the workout routes in the Apple Fitness app after writing the recorded GPS data to HealthKit via HKWorkoutRouteBuilder.
The smaller distanceFilter, Fitness will displays the route.
Should I consider setting up a small distanceFilter when developing a workout app on watchOS?