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?
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?
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 :)
© 2022 - 2024 — McMap. All rights reserved.