jordansinger/health-macos-swiftui-example

Possibility to use apple health data that is synchronized in iCloud?

Opened this issue · 2 comments

At some point recently apple started making it so that apple health could sync its data through iCloud. This didn't exist 2 or 3 years ago but when I looked the other day, it did, and it works fine. Of course, none of this data is visible in iCloud drive. I'm posting this here because I figured it might be a place other people who are interested in the same thing might look.

I figure if someone reverse engeneers the method iPhones use to sync with iCloud, and then that is used to log in and sync the health data from a MacOS app, there can be a constantly in-sync health app on Mac. Or Linux or whatever. And able to integrate with e.g., third party health dashboards, personal web sites (automatically post your latest workout), or things like home assistant.

I know there are ways to get this data, by way of other third-party iPhone apps, but all of these require the app to be running and regularly run in the background, and the syncs aren't up to date (e.g., I can't get my latest up-to-date step count from my apple watch in a bash script, although I could use one of those apps to get my several-hours-old step count in a bash script.

So I guess I'm wondering if anyone know of any project where someone has made any headway in this. I'll try posting in relevant places on reddit too probably. I might try to tackle it too but I'm pretty far away from the knowledge required. If you have some helpful hints for me let me know. Thanks!

Since iOS 16 automatically calculates Active Energy based on the movement data without the option to disable these calculations (and Apple doesn't allow deleting health records from a shortcut), this possibility would allow a ton of other possibilities to script with the Health app (optimizations, cleanups, statistics, ...).
@fivestones Did you found any useful information in the meantime?

No, sorry, I haven't figured out anything more so far.