rn-apple-healthkit
rn-apple-healthkit copied to clipboard
getDailyDistanceWalkingRunningSamples not working
Hi,
i'm trying to get the dailyDistanceWalkingRunning but i always get an ampty array.
Data is there, and i can access it, because getDistanceWalkingRunning works fine:
AppleHealthKit.getDistanceWalkingRunning({}, (err, res) => console.log(res));
Returns:
{"endDate": "2020-01-29T14:40:00.000+0100", "startDate": "2020-01-29T14:40:00.000+0100", "value": 8046.72}
But the daily aggregate is empty:
AppleHealthKit.getDailyDistanceWalkingRunningSamples({ startDate: "2020-01-01T14:40:00.000+0100", endDate: "2020-01-29T14:40:00.000+0100", limit: 5 }, (err, res) => console.log(res));
[]
I've tried to add the limit, to remove and add again endDate... no luck. I'm using v0.8.0 on the Emulator.
Do you tried to manually add samples in your Simulator?
Go to Health app in your simulator > click in "Health Data" from bottom tab > select "Activity" >select "Walking Running DIstance" in list > Add manually samples
Yes, in fact i got the results when using the getDistanceWalkingRunning method.
Anyway, i managed to get the Workouts instead of the Distance and opened a PR to fix a bug about the Workout consents. This library has a lot of problem (logs forgotten, lack of documentation, etc).
Yes, working with this lib yesterday, I watched same problems (and anothers) ;/