I’m trying to understand how often I can get updates on stuff like Heart Rate , Oxygen Saturation and movement.
I'm building a third party app that detects sleep phases so I need it to monitor all night (5-8 hours) and get an update at least every minute.
I don’t think I can use the HKWorkoutType class/subclass since it’s not really a workout, and I was told Apple might reject my application.
I understand I should be able to get something via enableBackgroundDelivery
Another post here suggests to use ExtendedRuntimeSessions
Can anyone give me some directions on the feasibility? Is there any way to access Heart Rate directly, without using the WorkoutSession classes?
PS What about movement? Is accessing the accelerometer easier?
Do you really need live updates every minute? More likely you want data from when the user was asleep, but not continuous monitoring. You can use a background observer query, which will provide the app with ~4-15 seconds of runtime every hour to process the data you're observing, if it has changed.
https://developer.apple.com/documentation/healthkit/hkobserverquery/executing_observer_queries