Best solution yet. thank you.
Post
Replies
Boosts
Views
Activity
I'm having the same issue, which happened when i created a watch app target on an existing iOS project (I get the error when attempting to run the Watch App). I'm assuming it's an issue with the build configuration or a bug, but haven't made much progress deciphering.
You're right, it still doesn't work. I switched to use updateApplicationContext when testing on the simulator, and figured one day it'll work again.
Do you need to enable background processing?
I've had some success by moving the synthesizer out as a global property.
var synthesizer = AVSpeechSynthesizer()
class TextToSpeechPlayer: NSObject {
//private var synthesizer = AVSpeechSynthesizer()
override init() {
super.init()
prepareAudioSession()
synthesizer.delegate = self
}
deinit {
disableAudioSession()
}
Just call it directly.
// it appears handleActiveWorkoutRecovery isn't called, so we are updating the name, and calling it directly.
func checkForActiveWorkoutSession() {
HealthStoreManager.shared.healthStore.recoverActiveWorkoutSession { (session, error) in
if let session {
Crashlytics.crashlytics().record(error: NSError(domain: "Workout Recovery", code: 00, userInfo: nil))
WorkoutFactory.shared.restoreSession(session)
}
}
}