Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Live Heart Rate in watchOS 3

I'd like to access the live heart rate at in my apple watchOS app. In the keynote they emphasized that developers can access the live data now. But I can't find anything about it in the documentation.

Does anyone have a hint for me?

like image 599
Jonathan Avatar asked Jul 02 '16 09:07

Jonathan


People also ask

How do I find my real time heart rate on my Apple Watch?

Open the Heart Rate app on your Apple Watch. Tap Current, Resting Heart Rate, or Walking Average to show your heart rate throughout the day.

Does Apple Watch Series 3 track heart rate?

In addition, Apple Watch measures your heart rate throughout the day when you're still, and periodically when you're walking (Apple Watch Series 1 or later).

Can Apple Watch broadcast heart rate?

The WATCH LINK™ pod enables you to stream heart rate from your Apple Watch to any ANT+ compatible equipment. You must have either a WATCH LINK™ pod in order to use this app. The app requires connection to a pod prior to starting a workout.


1 Answers

The GitHub project you mention (github.com/coolioxlr/watchOS-3-heartrate) in your comment is a really good place to start.

In order to get the heart rate data, your app is going to first need to request read access to HealthKit for the heart rate data. Unfortunately, you are unable to get the data directly from the sensor so you will have to query for it from HealthKit. To do so, you will need to create a streaming query. If you want it "live" or with a high sampling rate, you should create a workout session. Just remember to end the workout session (particularly while testing) because otherwise the workout continues (you will see the little green workout icon at the top of your watch face) and your watch will burn through the battery. If that happens open up the Apple work out app on your watch, start a work out, and then end it, as starting a new workout session ends an old one.

I hope this helps you get started :)

like image 191
immadbananas Avatar answered Oct 21 '22 19:10

immadbananas