My requirement is like enabling TTS(Text To Speech) for UILocalNotification alert body in background. So that the system will read the alert body at the same time it shows its corresponding notification.
Thanks much in advance.
My requirement is like enabling TTS(Text To Speech) for UILocalNotification alert body in background. So that the system will read the alert body at the same time it shows its corresponding notification.
Thanks much in advance.
When your local notification comes into your foregrounded app, you can do something like:
AVSpeechUtterance *utterance = [AVSpeechUtterance
speechUtteranceWithString:@"Replace this sentence with contents of local notification"];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
[synth speakUtterance:utterance];
I'm not certain the synthesizer can be used while the app is in the background and out of sight of the user.
And more detail about this can be found in this related question.