WKExtendedRuntimeSession vs HKWorkoutSession

I am developing a watchOS app related to Bluetooth.

I often used WKExtendedRuntimeSession to connect Bluetooth even in the background, but I often lost the connection. so I used HKWorkoutSession, it works. i go through two official documentation, but i don't know the difference between them.

What's the difference of these two sessions?

And do those sessions affect the use of Watch Connectivity transferUserInfo?

Answered by Frameworks Engineer in 738180022

These APIs are meant to cover specific use cases. Use HKWorkout for workout sessions and WKExtendedRuntime for self-care, mindfulness, physical therapy, or smart alarm sessions. What is your app actually doing?

Accepted Answer

These APIs are meant to cover specific use cases. Use HKWorkout for workout sessions and WKExtendedRuntime for self-care, mindfulness, physical therapy, or smart alarm sessions. What is your app actually doing?

WKExtendedRuntimeSession vs HKWorkoutSession
 
 
Q