iPhone 6 - Not speak push notification message in background

I am doing an iPhone app which speaks push notification message in background & foreground using AVSpeechSynthesizer and AVAudiosession. Its speaks the message in background on iPhone 4,4s,5,5c devices but its not working in iPhone 6.

In iPhone 6, push notification message not speak when in background.


I created a audio session once the push notification fires in didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler method, then pass the notification message to AVSpeechsynthesizer to speak.


After message read, deactivate the audio session by [session setActive:NO error:&error]


AVAudioSession* session = [AVAudioSession sharedInstance];

NSError* error = nil;

BOOL success = [session setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&error];

success = [session setMode:AVAudioSessionModeMoviePlayback error:&error];

success = [session setActive:YES error:&error];


Please help me to solve the background - voice notification issue in iPhone 6.

I found a workaround for my version of this problem: play a small snippet of plain old sound (with AVAudioPlayer) right after the call to speakUtterance(). Of course, I used a snippet of silence. This seems to "jog the audio queue" and results in proper playing of the speech, in foreground, background, and when the phone is asleep or with the lock screen showing. I was triggering the speech from Apple Watch, but I think this should work with push notifications too.

Hi Kumar,


whats the Name for your App ?

I search exactly for such that. Can it Receive an Speak my Text ?

Apple´s Push notifications work really great. But i don´t see an App that can speak that Text out.


For now i use Android for that tasks.


greetings

Christian

iPhone 6 - Not speak push notification message in background
 
 
Q