Real time heart beat data from Apple Watch using HKHeartbeatSeriesSample
There isn't a way to record heart rate more precisely than you have already observed using the workout session API. Samples of the HKSeriesType.heartbeat()
type are recorded when Apple Watch computes heart rate variability (see the sample type heartRateVariabilitySDNN
). HRV is computed periodically in the background by Apple Watch. There is no API for initiating an HRV reading.
Track beat to beat heart rate apple watch through HRV
After filing an technical support incident (TSI) at Apple about this, they said that it's currently not possible to do this.
Thank you for contacting Apple Developer Technical Support (DTS). Our engineers have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations.
If you would like for Apple to consider adding support for such features in the future, please submit an enhancement request via the Bug Reporter tool at https://developer.apple.com/bug-reporting/.
If you'd like to see this functionality, please file a bug report!
Querying for heartRateVariabilitySDNN in HealthKit?
Both HRV and VO2 Max samples are available to developers using HealthKit (you should be able to verify this by querying for them on an iPhone without a predicate). However, they are not calculated continuously by watchOS so you cannot depend on having a recently computed value of either type at any given time. The circumstances under which new HRV samples are computed is not documented, but you should be able to trigger the measurement of HRV by using the Breathe app.
Related Topics
Fix Cursor Size for Modified Paragraph Spacing in Uitextview
Xcode Reference a Framework Instead of Link Binary with Libraries
Uicollectionview - Horizontal Paging with One Cell at a Time
Error Domain=Kclerrordomain Code=2 "The Operation Couldn't Be Completed. (Kclerrordomain Error 2.)"
iOS Today Extension with Core Data
How to Pair And/Or Bond to Ble on iOS Using Swift Code and an Hm-10 So Data Sent Is Encrypted
Disabling Allowsbackgroundlocationupdates (Cllocationmanager) Doesn't Work After Is Was Enabled
How to Solve Mach-O-Linker Error in iOS7 & Xcode 5.0.1
How to Convert Cgpoint in Nsvalue in Swift
How to Animate Dark Mode Change in iOS
Should I Use Realm Objective-C or Realm Swift in My Mixed Objective-C/Swift Project
How to Animate Uilabel's Textcolor Change
Cloudkit Push Notifications on Record Update Stopped Working
iOS Add Button to Widget Extension
Use Elcimagepickercontroller to Pick Video
How to Set Requestserializer in Alamofire
Initialization of 'Unsafepointer<Int>' Results in a Dangling Pointer