How to use CMHighFrequencyHeartRateData to read the Heart rate data from CoreMotion framework

Hello,

As per Apple Documentation Link for CoreMotion framework we can read high frequency heart rate using CMHighFrequencyHeartRateData but there is No way to set the type like heartRate and have a updateHandler to provide the heart rate data. But for Accelerometer data, CoreMotion framework can provide startAccelerometerUpdates(to:, withHandler:) and user can set update interval like accelerometerUpdateInterval using CMMotionManager.

But There is no solution available for heartRate. If any solution is available to read heartRate using CMHighFrequencyHeartRateData it will be helpful for me.

I know we can read the Heart Rate Data using HealthKit framework using HKAnchoredObjectQuery but the heart rate data is not consistent and startDate & endDate for heart rate data is also not consistent. We want heart rate very frequent like every second.

Any help can be appreciated. Thanks in advance

Answered by DTS Engineer in 790419022

CMHighFrequencyHeartRateData is a data type that can only be accessed through the SensorKit Framework.

While SensorKit makes additional data types available, access to these data types is limited to research uses and requires an app to have a private entitlement.

You can read more about it in Accessing SensorKit Data

CMHighFrequencyHeartRateData is a data type that can only be accessed through the SensorKit Framework.

While SensorKit makes additional data types available, access to these data types is limited to research uses and requires an app to have a private entitlement.

You can read more about it in Accessing SensorKit Data

How to use CMHighFrequencyHeartRateData to read the Heart rate data from CoreMotion framework
 
 
Q