This is just a follow up message, just in case anyone else has similar need and could be useful info.
I don't have anything to share about how often the system samples the heart rate while the user sleeping, but you can start with grabbing the data from the HealthKit store, and see if that is good enough for your analysis.
I made a prototype to check this and observed that the results are bit varying. That is to say, The app gets update between every 7-15 minutes, which is more than what I deciphered from the documentation :)
Thanks again for your pointers.
Post
Replies
Boosts
Views
Activity
Thanks very much Ziqiao Chen 🙏.
I will make a prototype and see how often we can get this.
Thanks for the response.
Multiline
BlockQuote For sleep tracking, if you set up a sleep schedule and turn on sleep tracking on your Apple Watch, the watch will track your sleep and put the relevant health data (including heart rate) into the HealthKit store. Your app can then access the data with HealthKit and do sleep analysis based on that. Does this path work for you? If not, I'll be curious why it doesn't, and also why you need to measure the heart rate every 5 seconds.
Our app needs to measure the heart rate every 5 seconds in order to track the sleep stage of the user and our companion iOS app will "assist" user accordingly for uninterrupted sleep.
Using the sleep data from HealthKit could still be interesting for us as long as we get the data in time.
How latest information could we get from Healthkit with this approach? We could still relax the frequency as low as
0.033 Hz (every 30 seconds).
The only reason we use workout mode is to get the heart rate even when the app goes in background mode. Is. there any other option to achieve this?
Thanks for the suggestion about Fitness.app. That would be useful too. But with the large battery drain, the primary goal is to find alternates to workout.
Thanks a ton for your time. I have been stuck on this for a bit now. Any further pointers would be greatly helpful.