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

Question: Can I get the current heart rate without having to wait for the workout to end?

Open austinGENEreeve opened this issue 3 years ago • 3 comments

I'm trying to get the current Heart Rate. I'd like to be able to be able to get it every 5 seconds but 20 or 30 seconds would work as well.

I've noticed that when I query the heart rate was only updated every 5-6 minutes. To get around this I started a workout on my watch. "Mind and body" or "other" this increased my heart rate samples to 5 seconds. Only issue is that I can't seem to query these values until I end the workout. If I query during the workout I get the reading from 5-6 minutes ago.. But as soon as I end the workout, I can go back and see my heart rate throughout at 5 second intervals?

Is there a way to get a realtime heart rate?

what my query and options look like:

const options = {
        startDate: new Date(2021, 9, 24).toISOString(),
        limit: 3,
      }
      AppleHealthKit.getHeartRateSamples(
        options,
        (results) => {

austinGENEreeve avatar Oct 24 '21 19:10 austinGENEreeve

@austinGENEreeve did you find a way to overcome this issue?

gilador avatar Nov 10 '21 06:11 gilador

@gilador No luck.

austinGENEreeve avatar Nov 12 '21 08:11 austinGENEreeve

@austinGENEreeve I know it's been a while since you posted but have you had any luck as I'm interesting in a similar feature for my app? Thanks

AidenForrest avatar Jan 17 '22 21:01 AidenForrest