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.