I am creating a workout app in Apple Watch with the HKWorkoutSession and using HKLiveWorkoutBuilder to access the live data like distance, calories, heart rate. The user can pause and resume the workout as well. Suppose I pause the workout after 5 minutes and then kill or force quit the app. After it when I relaunch the app again after 5 minutes more then the builder elapsed time does not includes the pause duration because the activity is again started from the start time. How can I get the current working workout session that I last created before killing the application? This works well when the application is either in foreground or in background.
How can I get the current active workout session when the app is relaunched after killing the app in Apple Watch?
Add a Comment