Here's how I'm doing it - works reliably but App Review will give you a hard time about using HealthKit:
if HKHealthStore.isHealthDataAvailable() {
Task {
let configuration = HKWorkoutConfiguration()
configuration.activityType = .skatingSports
configuration.locationType = .outdoor
let store = HKHealthStore()
do {
try await store.startWatchApp(toHandle: configuration)
}
catch { }
}
}
Topic:
App & System Services
SubTopic:
Core OS
Tags: