WatchOS6 handleActiveWorkoutRecovery not being called after workout crashes

308 Views Asked by At

I'm creating a workout app and I'm trying to implement the workoutRecovery logic but the handleActiveWorkoutRecovery function is never being called when an app crashes or is forced closed.

Are there any special circumstances that must be met so that the handleActiveWorkoutRecovery?

func handleActiveWorkoutRecovery() {
        NSLog("log: handleActiveWorkoutRecovery");
        self.healthInfo.recoverWorkout()
        self.healthInfo.workoutRecovery = true
    }

Moreover, in Content.swift I have the following code so that in case the login is not working I could see visual feedback that the handleActiveWorkoutRecovery function is being called:

@EnvironmentObject var healthInfo: HealthInfo

var body: some View {
    VStack{
        if(healthInfo.workoutRecovery){
            Text("RECOVERY")
        }else{
            TestView()
        }
    }

}

When the app relaunches it never goes to The Text("RECOVERY") view.

Deployment target is 6.1 and I'm using an Apple Watch 4 running 6.1 beta 3

Ive also tested the native apple workout app and that seems to recover as it should

0

There are 0 best solutions below