Hello everyone,
I'm developing an app for visionOS that utilizes HealthKit to query heart rate data. However, I'm encountering an issue where the app doesn't retrieve the latest heart rate values. Specifically, it fails to get live heart rate data even after the data has been saved to the Health app. The readings my app displays are outdated and do not match the current values shown in the Health app.
Here's what I've tried so far:
-
Fetching Heart Rate Samples: Used HKSampleQuery and HKAnchoredObjectQuery to fetch the most recent heart rate samples. Despite this, the data retrieved is still not up-to-date.
-
Checking Permissions: Ensured that all necessary HealthKit permissions are granted. The app has authorization to read heart rate data and write workout data.
My questions are:
Is there a known issue or limitation with HealthKit on visionOS that prevents apps from accessing the latest heart rate data?
Are there additional steps or configurations required to access live heart rate data in visionOS apps?
Has anyone successfully implemented live heart rate monitoring on visionOS, and if so, could you share how you achieved it?