Open pjsandwich opened 1 year ago
I think this is related to https://github.com/agencyenterprise/react-native-health/issues/284
Update: After changing my query startDate
to the meginning of the month, I retrieve the heart rate data. Unsure as to why the start of the day does not return anything.
Describe the bug
AppleHealthKit.getHeartRateSamples
is returning an empty array[]
regardless of existing data and permissions.To Reproduce Steps to reproduce the behavior:
successfully initialize healthkit with:
In this case, I initialize this data from a
useEffect
hook which sets auseState
hook value in a constant viasetWearablesPermissionStatus(true)
(or false in the case of error).From my context, I query the most recent record of heartRate from my database and set either
[]
if the user doesn't have any data, or the data is set as the most recent item.request
AppleHealthKit
like this:Getting this response:
healthkit heart rate results: [] 0
Expected behavior
AppleHealthKit.getHeartRateSamples
should return an array of the data within the time frame as opposed to an empty array.Screenshots Screenshots from Apple Health showing existing data and the existence of heart rate values:
Smartphone (please complete the following information):
Additional context I have a
getSleepSamples
query which seems to work fine with the same setup in my code. However,getHeartRateSamples
andgetSamples
does not work as expected. Maybe it's as simple as a permission issue? Do I need more permissions for this data?