Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

How to run HKWorkoutSession on watch without affecting activity rings?

My research group is using watch sensors (accelerometers, gyroscopes) to track wrist motion to detect and measure eating. https://cecas.clemson.edu/ahoover/bite-counter/

We are running an HKWorkoutSession on the watch so that the app can run for an extended period of time (up to 12 hr) and continue to sense and process motion data.

Our app is adding to the activity rings, making it look like the user is exercising the entire time our app is running. Is there a method to prevent our app from contributing to the activity ring measures?

We are running an HKWorkoutSession on the watch so that the app can run for an extended period of time (up to 12 hr) and continue to sense and process motion data.

I don't have any expertise about eating measurement and motion detection, but this doesn't sound like a valid use of HKWorkoutSession, according to App Review Guidelines 2.5.1 - Performance - Software Requirements. Also, running a HKWorkoutSession for 12 hours will consume a lot of energy (battery level), which won't be a great user experience.

Is there a method to prevent our app from contributing to the activity ring measures?

Would you save the data to the HealthKit store? If you do, the rings will reflect activities.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

The app is only being distributed to subjects in a research study (N=275). We are not designing for consumer-level app review.

We are calculating custom measures from raw accelerometer/gyroscope data. One of the measures is calculated every 30 sec on a sliding 6 min window, which we call P(E) the probability the subject is eating. This must run all day to monitor subject behavior. But we do not want to affect the activity rings measures.

Oh, that makes sense. Thanks for your clarification.

In the case, is it appropriate to not call finishWorkout(completion:) after stopping the workout? That way, you can still collect the data points while the workout is ongoing, and don't impact the rings because the workout data isn't saved.

I don't see any way to save a workout to the Health store without impacting the rings, if the workout contains the data relevant to the rings.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

How to run HKWorkoutSession on watch without affecting activity rings?
 
 
Q