With Watch OS 2.0 developers are supposed to be allowed to access heart beat sensors.... I would love to play a bit with it and build a simple prototype for an idea I have, but I can't find anywhere info or documentation about this feature.
Can anyone point me on how to approach this task? Any link or info would be appreciated
You can get heart rate data by starting a workout and query heart rate data from healthkit.
Ask for premission for reading workout data.
In AppDelegate on iPhone, respond this this request
Then implement Healthkit Delegate:
Now it's time to write [self updateHeartbeat:date]
You also have a turn on Healthkit in capbilities. Leave a comment below if you have any questions.
You may use HKWorkout, which is part of the HealthKit framework.
Many of software kits for iOS are now available for watchOS, such as HealthKit. You can use HealthKit (HK) functions and classes in order to calculate burned calories, find heart rate, etc. You can use HKWorkout to calculate everything about workouts and access the related variables such as heart rate, just like you did with iOS before. Read developer documentations from Apple in order to learn about HealthKit. They can be found in developer.apple.com.
Apple isn't technically giving developers access to the heart rate sensors in watchOS 2.0. What they are doing is providing direct access to heart rate data recorded by the sensor in HealthKit. To do this and get data in near-real time, there are two main things you need to do. First, you need to tell the watch that you are starting a workout (lets say you are running):
Then, you can start a streaming query from HKHealthKit to give you updates as HealthKit receives them:
This is all described in full detail in the demo at the end of the video What's New in HealthKit - WWDC 2015