Good evening,
when I use the automatic export feature from my iPhone, it successfully exports data. When reading the Export.xml file it is dispayed completely, with about 3 mio lines.
When I check the file I see, that a lot of data is missing. E.g. the iPhone dispays the heart rates for several exercises (from last year), which don't have any correspondence in the export.xml file. Current exercises have.
I am a developer myself and parsed all files without any error. My iPhone has enough free space (200GB or so) and iCloud has more than a TB free. Internet is connected via 1GBit line, WLAN with 800MBit and everything runs smooth.
I would like to get a COMPLETE export of all the health data, without having to write a program on my own to accomplish this.
Thank you.
/C
Health & Fitness
RSS for tagExplore the technical aspects of health and fitness features, including sensor data acquisition, health data processing, and integration with the HealthKit framework.
Post
Replies
Boosts
Views
Activity
Finally at last Apple Health supports saving .distancePaddleSports, .distanceCrossCountrySkiing, .distanceRowing, .distanceSkatingSports, and much more.
The backstory. In the land of 10,000 lakes, there hasn't been a way to save 'canoe' or 'kayak' distance and I've been asking for it for years. Thank you health team for adding it this year!
FB7807993 - Add HKQuantityTypeIdentifier.paddleDistance for canoeing, kayaking, etc type workouts (June 2020)
Prior we could just save the totalDistance to a workout, but since the HKWorkout initializers were deprecated we no longer have a supported way to save these distances in our workouts. The iOS 18 / watchOS 11 introduction addresses this. If you want to know more why you can't do this in earlier versions you can check these feedback titles:
FB10281482 - HealthKit: Deprecation of totalDistance on a workout session of paddleSports breaks apps that used that to save distance to the workout because there is no "paddleDistance" type available to save as sample data (June 2022)
FB12402974 - HealthKit: Deprecation of HKWorkout completely breaks support for third party fitness apps from saving non-standard workout distance (June 2023)
Great, so there is new support that solves all of these requests and issues for the new version of the OSes. However, the downside is now that there is not much for documentation. Unlike the .runningSpeed and .runningPower introduced in iOS 16 / watchOS 9, none of the new iOS 18 / watchOS 11 types have documentation, at all. To some degree this is understandable, but types from last year still remain undocumented too.
Without this information for the data types introduced in both iOS 17/18 and watchOS 10/11 it makes building and integrating with these new types difficult to say the least. We can't make assumptions about anything.
Can we get a documentation update for new (and existing) quantity types for when Apple Watch will automatically generate samples?
FB14236080 - Developer Documentation / HealthKit: Update documentation for HKLiveWorkoutDataSource typesToCollect for which sample types are automatically collected by watchOS 10 and 11 (July 2024)
FB14942555 - HealthKit / Documentation: App Update Release Issue - HKQuantityTypeIdentifiers are missing documentation describing when the system automatically adds data (today)
I know that the behavior has changed from release to release for some of these types, so documentation would be based on OS version. If you didn't catch it, watchOS 11 will now associate .cyclingSpeed for cycling workouts both indoor and outdoor.
FB12458548 - Fitness: Connected cycling speed sensor did not save samples to health via cycling workout (June 2023 - received reply that only saved for indoor cycling, but not documented otherwise)
FB14311218 - HealthKit: Expected outdoor cycling to include .cyclingSpeed quantity type as a default HKLiveWorkoutDataSource type to collect (July 2024)
To the other third party fitness apps out there, how are you managing the knowledge of which devices collect which data types on which versions of the OS?
Sure, we could look at the HKLiveWorkoutDatSource and inspect the typesToCollect property across a bunch of devices, but again that is trial by error not 'as documented'. Is the behavior of simulators guaranteed to match the behavior of real devices? Maybe, but also maybe not.
Fingers crossed for a nice documentation update to spell out all of the behavioral details.
Apple folks / DTS, many of the above feedbacks are addressed and I plan to update or close them after the releases this fall. Some are still outstanding.
P.S. I hope that .paddleSports gets deprecated and split into individual activity types like skiing did years ago. Their MET scores are different according to the research on the physical activity compendium site.
FB7807902 - Split HKWorkoutActivityType.paddleSports into their own activity types (June 2020)
I am building an app that sends workout data to Apple Fitness. During development I noticed that my App Icon does not show up in Apple Fitness and it's just a blank space. The Icon seems to show just fine in Apple Health but not in Apple Fitness.
I did the same test with the production version of my app and I can see the production icon just fine in Apple Fitness. I am trying to find information about which app Apple Fitness uses since it seems to differ from the one Apple Health uses. ChatGPT seems to think that Apple Fitness uses the App Store Connect icon (which I have for my prod app but not my dev app), but I cannot seem to verify that assumption with any kind of documentation.
Can I please get information about which icon specifically Apple Fitness uses when displaying third party app integration information?
Does watchOS 11 detect naps? Are these recorded as 'asleep' samples in Apple Health?
Hi there!
I've using the betas for a month now, and 18.1 at the moment.
I've always had my Health App crashing once I tap on "Treatments".
Is it a know bug? Is it working properly on your phones?
I've already sent a feedback, but got not answer yet.
Thanks ^^
must add the same happens on my iPad using beta version as well
Hi! I've added the code of the multidevice workout app from Apple to my app and I found some issues that I cannot see on the sample app.
In my app, to pause or end the workout from the watch, the iOS companion app has to be opened or at least on background, but never closed.
What I'm doing wrong?
Hello!
My sleep process isn't recorded with iPhone only (without wearable device) on iOS 18. On previous iOS versions it was recorded but now it doesn't work.
I compare iOS 17 and iOS 18 Beta and I see the difference that in Full Schedule was deleted tumbler "Track Time in Bed with iPhone" that helped to track sleep process without wearable device (I found it here: Health app -> Browse -> Sleep -> Your schedule block and tap on "Full Schedule & Options" -> Scroll to the bottom).
I didn't find any information from Apple about this changes in change log.
And one more time: I don't use Apple Watch or any wearable device.
Do you have any information about sleep tracking with iPhone only? Can I track sleep process only with iPhone?
HealthKit tracker Id is the same with another Device, We are using an application to track our health progress and we are trying to connect our HealthKit to monitor our health data (steps and calories) but unfortunately we can't connect to the app (another application) at the same time because two devices is sharing just one health kit tracker ID. Can anyone help me to resolve this issue? Old phone was used by the other person before changing to new phone
On watchOS 11 when starting a workout session a widget appears automatically on the smart stack showing the pause or resume button.
It´s a great feature, but my problem is that the duration is not showed correctly because the prepare phase of the workout and the pause / resume events are not taken into account calculating the duration.
In my project I don´t use the workout builder. I have made a sample project with workout builder and there the duration is shown correctly.
It would be great if this automatically appearing widget would also show the time correctly in case the workout builder is not used (prepare phase and pause resume events considered, otherwise it looks like a bug).
Is there any way to opt out of this automatically appearing widget or could this be fixed? Any comments from an Apple engineer on this?
My iOS app has a correctly configured HealthKit integration. It successfully delivers all samples and data to HealthKit. For every workout sent to HealthKit, I can see the duration, workout name, calories, and other details.
However, the app icon is missing. My project uses the Single Size setting for the app icon in the XCAssets folder. The app is available in the App Store in some regions. What can I do to fix this issue?
The problem persists regardless of whether the device is running iOS 17 or 18.
In my app im able to get the live heart rate when app is in foreground. When app is in background/ locked condition live heart rate is not fetched.
How to get live heart rate frequently.
I have integrated HealthKit into my app to track and display step data. On my iPhone, the step data syncs and shows up immediately. However, when I try to fetch and display this data on my Vision Pro app, there's a noticeable delay before the data appears, even though I've given the necessary permissions and synced data through iCloud.
Memory updated
Here is your question in a similar format:
Hi everyone,
I'm developing a visionOS app using SwiftUI and RealityKit. I'm facing a challenge with fetching step data from HealthKit.
Scenario:
I have integrated HealthKit into my app to track and display step data. On my iPhone, the step data syncs and shows up immediately. However, when I try to fetch and display this data on my Vision Pro app, there's a noticeable delay before the data appears, even though I've given the necessary permissions and synced data through iCloud.
Question:
Why is there a delay in fetching step data from HealthKit on my Vision Pro app, and how can I reduce this delay to ensure real-time data display?
Additional Information:
I'm using HKStatisticsQuery to fetch the step data for the current day.
The authorization for HealthKit is requested successfully.
The data shows up after some time, but the initial delay is causing a poor user experience.
Here is the relevant code snippet for fetching today's steps:
class HealthManager: ObservableObject {
let healthStore = HKHealthStore()
@Published var activities: [String: Activity] = [:]
init() {
let steps = HKQuantityType(.stepCount)
let healthTypes: Set = [steps]
Task {
do {
try await healthStore.requestAuthorization(toShare: [], read: healthTypes)
} catch {
print("error fetching health data")
}
}
}
func fetchTodaySteps() {
let steps = HKQuantityType(.stepCount)
let predicate = HKQuery.predicateForSamples(withStart: .startOfDay, end: Date())
let query = HKStatisticsQuery(quantityType: steps, quantitySamplePredicate: predicate) { _, result, error in
guard let quantity = result?.sumQuantity(), error == nil else {
print("error fetching today's step data")
return
}
let stepCount = quantity.doubleValue(for: .count())
print("stepCount \(stepCount)")
}
healthStore.execute(query)
}
}
I'm open to alternative approaches if this method isn't the most efficient for real-time data fetching.
Thanks in advance for any insights or suggestions!
Best,
Siddharth
Are there any limitations on how long iOS will continue delivering background updates from HealthKit to the app? Will deliveries be suspended if the user stops opening the app for a few days, a month, or longer?
We have an app that takes data from the accelerometer of the iPhone and watchOS. Some updates ago we included the high-frequency accelerometer for the watchOS with the CMBatchedSensorManager framework.
We didn't test our app on iOS 16 or 15 devices, where that framework is unavailable, because the update was just for watchOS. We refer to that class just on a shared class, and was wrapped with an #if os(watchOS) condition.
In our iPhone app, we import the CoreMotion framework but CMBatchedSensorManager is not used.
Now, when you run the app on a device with iOS 15 you find this issue: dyld[17071]:
Symbol not found: (OBJC_CLASS$_CMBatchedSensorManager)
Referenced from: '/private/var/containers/Bundle/Application/C3CC754F-1674-4CBD-AD83-93229DDCF38D/Spleeft.app/Spleeft'
Expected in: '/System/Library/Frameworks/CoreMotion.framework/CoreMotion'
We need a solution to keep running our app on devices with iOS 15.0
Hello, I am trying to build a features where I want to monitor a user's biking workout session metrics like the current speed, average speed and distance travelled. I want to get these metrics as the user is actively doing a workout session in the Workouts app of the apple watch. Is it possible? Or it is not possible to get data from an active workout session from the workouts app.
** BUILD FAILED **
The following build commands failed:
Ld /Users/siddesh/Library/Developer/Xcode/DerivedData/App-ddpkkzvberburtewkcvoihnirgjh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging normal x86_64 (in target 'Logging' from project 'Pods')
(1 failure)
Testing with xcodebuild.
-> mySDK_Staging (8.8.0)
- WARN | attributes: Missing required attribute license.
- WARN | license: Missing license type.
- WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
- WARN | [iOS] license: Unable to find a license file
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | [iOS] xcodebuild: note: Building targets in dependency order
- NOTE | [iOS] xcodebuild: note: Target dependency graph (20 targets)
** BUILD FAILED **
The following build commands failed:
Ld /Users/siddesh/Library/Developer/Xcode/DerivedData/App-ddpkkzvberburtewkcvoihnirgjh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging normal x86_64 (in target 'Logging' from project 'Pods')
(1 failure)
Testing with xcodebuild.
-> mySDK_Staging (8.8.0)
- WARN | attributes: Missing required attribute license.
- WARN | license: Missing license type.
- WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
- WARN | [iOS] license: Unable to find a license file
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | [iOS] xcodebuild: note: Building targets in dependency order
- NOTE | [iOS] xcodebuild: note: Target dependency graph (20 targets)
** BUILD FAILED **
The following build commands failed:
Ld /Users/siddesh/Library/Developer/Xcode/DerivedData/App-ddpkkzvberburtewkcvoihnirgjh/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/Logging.build/Objects-normal/x86_64/Binary/Logging normal x86_64 (in target 'Logging' from project 'Pods')
(1 failure)
Testing with xcodebuild.
-> mySDK_Staging (8.8.0)
- WARN | attributes: Missing required attribute license.
- WARN | license: Missing license type.
- WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
- WARN | [iOS] license: Unable to find a license file
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | [iOS] xcodebuild: note: Building targets in dependency order
- NOTE | [iOS] xcodebuild: note: Target dependency graph (20 targets)
Hey folks, a couple of questions regarding WorkoutKit:
What happened to validation errors? They are mentioned in the WWDC23 video, but no longer are present in the API. It seems a fatal error is thrown if the workout fails validation (for example setting a negative distance in a workout goal).
What is the logic of the WorkoutScheduler, if we try to add more workouts than is allowed? If the limit is 50, what happens when we try to add a 51st? Are workouts de-queued based on date or anything? API documentation is very sparse
Do completed workouts and workouts with a scheduled date in the past stay in the WorkoutScheduler? Are we responsible for removing these? I guess my overall question regarding the WorkoutScheduler is, what are we responsible for managing and what is handled gracefully for us.
None of these answers seem to be openly available, but if anyone know anecdotally or even better from the WorkoutKit team, I'd be very grateful!
Thanks!
I receive multiple resting heart rate readings throughout the day. I understand these readings are taken during the day while sedentary. However, if I query for:
HKQuantityType.quantityType(forIdentifier: .restingHeartRate)
I only receive ONE sample for the day, even though throughout the day multiple samples are observed. This is confirmed by looking at the Apple Health app and seeing only one recorded resting heart rate each day.
Is there a way to get the individual resting heart rate readings for the .restingHeartRate type or am I stuck with querying the raw heart rate data for sedentary values (which don't always match Apples reported rhr)?