Add HKStatisticsCollectionQuery
Opened this issue · 3 comments
HI @robertherber - I'm building an app where I'd like to show step counts by day for the last 30 days (or year etc.)
I think the right way to do this is using a HKStatisticsCollectionQuery where interval is something like day = 1. I haven't tested against a real user with lots of step data but I'm guessing calculating it via step samples will be too slow.
Curious if you agree with the above statement? If so, I'm happy to work on adding that API to the library.
Thanks again for putting this library together, very well designed and I've learned a lot about Swift, HealthKit and native module dev from it!
Hi @davidyang,
I guess it would probably be technically possible with step count samples, but to creating a responsive UI straight from the HealthKit query would probably be quite slow.
So sounds like a great idea, would be happy to merge such a PR! :)
Hey @robertherber - I put together a pull request https://github.com/davidyang/react-native-healthkit/tree/addStatisticsCollection - would love your opinion on if it's the right path. I'm able to get it working with some hacky updates to the example app (I think because I have Xcode 15). I had to update some target_versions and Podfiles.
Hi,
WIll this be added in the near future? that would be very interesting for me as i am building an app that would benefit by loading the statistics from healthkit and not all the samples.