WatchOS 2 Heart Rate

Hi fellow developers,


We had to wait for it but it's finally here.. or isn't it?


Just a regular question about the new heart rate option in Watch OS 2 beta. Can my running app benefit from heart rate monitoring every second or do we have to use the healthkit version which only refreshes every 10 minutes (or so?).


Anybody?

Any answers? This is really frustrating. They released it as a major feature, but wait... you actually don't get access to the health sensors, you just get to pull it from healthkit which doesn't allow you to tell you how often this is called?


UHHH

Pretty sure devs are currently obligated to go thru HK to get to the HRS.

I'd love to know if there is an HK alternative for more realtime heartrate data. It really was held up and touted as a new feature, so I feel like there must be a way to get at it. watchOS 1 extensions AFIK could access HK already, so not sure how that would even be an improvement if that's all we get in OS 2.

Feel free to file a bug/feature request if you'd like an alternate access path.


My money is on it being over the horizon, if at all, as far as us avg. devs are concerned.

Accepted Answer

Ok, I did my research watching the WWDC 2015 - What's New in Healthkit video (https://developer.apple.com/videos/wwdc/2015/?id=203). If you skip to ~32:00 minutes, the keynote speaker called Mark is implementing Healthkit in it's Watch App. The BPM is monitored after authorizing on your iPhone the app may use HealthKit and will refresh the heartbeat every ~4 seconds. So yes, we can finaly stream the heartrate!

I can understand the heart rate BPM in real-time will be also in constant HKQuantityTypeIdentifierHeartRate

I wonder why they haven't released the source code for that session. Its like they DON'T want developers to know how to use this stuff easily

I posted the sample code on github

search "watchOS-2-heartrate"


including how to request authoriztion from watch.

WatchOS 2 Heart Rate
 
 
Q