Reply To: Managing interruptions from incoming phone call

Home Forums OpenEars Managing interruptions from incoming phone call Reply To: Managing interruptions from incoming phone call

#1019372
DaveM
Participant

Hi, some quick follow-up. It appears that I can manage all the issues I described relative to route changes due to phone calls with AVFoundation AVAudioSessionRouteChangeNotifications, which seem to work regardless of whether my app is backgrounded or foregrounded.

Your delegate methods appear to only work in the foreground (because they come from the main thread), so when my app is backgrounded due to an incoming call, I don’t get a route change notification that I can act upon.

By checking for 1) reason for route change and then 2) getting current input and output and 3) checking [[AVFoundation sharedInstance] isOtherAudioPlaying] before calling startListening, it seems that I can manage everything except the lock button sound issue.

I’m still optimizing and tuning, so I’ll confirm the final results, but it appears I don’t need to use an out-of-API call to make this work.

Thanks!
Dave