2

In my watchkit extension capability section there is no option to check the checkbox for audio in background mode section. I have also checked apple doc .

They are only 3 exception.

1) NSURLSession 2) WKAudioFilePlayer or WKAudioFileQueuePlayer 3) HKWorkoutSession

But i need my dynamic text to speak by the system. I am using this code

let dictSetting = UserDefaults.standard.value(forKey: "settings") as! [String : String]
let settingObj = SettingWatch(fromDict: dictSetting)
let utterance = AVSpeechUtterance(string: text)
utterance.voice = AVSpeechSynthesisVoice(language: "en-US")
self.synth = AVSpeechSynthesizer()
self.synth?.delegate = self
self.synth?.speak(utterance)

Is there any way that i can my Apple Watch app can speak the text even if in backgound. Or is there any way to keep my app in foreground? Please suggest if you have came across any solution.

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
  • Apple is quite restrictive on what can be done by 3rd party developers on the Apple Watch, especially when it comes to background execution. There's no way to achieve what you are trying to achieve at the moment. – Dávid Pásztor Feb 23 '18 at 20:18

0 Answers0