react-native-health
react-native-health copied to clipboard
To receive HOURLY Step Count Health Data
Is your feature request related to a problem? Please describe. Most of the get functions such as getStepCount() only take as input a day Date object for people to get a daily step count. However, I would find it to be extremely beneficial if hourly data is supported, since the Apple Health app presents hourly step count (and other sensor) data during the day. Currently, we have a a loss of data. I find that if i specify an hour in the date for HealthInputOptions, such as
const options: HealthInputOptions = {
date: new Date("2024-01-25T13:00:00").toISOString(),
includeManuallyAdded: false,
};
The step count data ignores the time and only takes in the day, and returns the daily step count.
Describe the solution you'd like It would be great if the get functions took hourly Dates as parameters too, and returns step counts during those hours
For example,
const options: HealthInputOptions = {
startTime: new Date("2024-01-25T13:00:00").toISOString(),
startTime: new Date("2024-01-25T17:00:00").toISOString(),
includeManuallyAdded: false,
};
Additional context I have also looked into background observers and adding listeners (which doesn't seem to work for most people), however that only provide current hourly/minute-ly data instead of past data.
If anyone knows a workaround please let me know!!! Thank you.
I would also be interested in this.
Tried to add unit: 'minute'
and it crashed
interested