react-native-health icon indicating copy to clipboard operation
react-native-health copied to clipboard

To receive HOURLY Step Count Health Data

Open Lemiex opened this issue 1 year ago • 3 comments

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.

Lemiex avatar Jan 27 '24 17:01 Lemiex

I would also be interested in this.

KesoGizmoYoshi avatar Feb 04 '24 13:02 KesoGizmoYoshi

Tried to add unit: 'minute' and it crashed

kfchan-git avatar Mar 28 '24 06:03 kfchan-git

interested

kourtc avatar May 27 '24 23:05 kourtc