Post not yet marked as solved
Post marked as unsolved with 0 replies, 400 views
There is some weird behavior routeChangeNotification not firing in certain scenario and this is easily reproducible.
Connect headphone (got new device added callback)
Change it to earpiece(the one you put your ear near for call) by setPreferredInput
Change it again to headphone by setPreferredInput
Remove headphone (no callback invoked)
Does anyone know this weird behavior? Is this expected for routeChangeNotification? I can't really find some useful documentation on this.
Following code is my category and mode
let audioSession = AVAudioSession.sharedInstance()
try audioSession.setCategory(AVAudioSession.Category.playAndRecord,
options: AVAudioSession.CategoryOptions.allowBluetooth)
try audioSession.setActive(true, options: .notifyOthersOnDeactivation)
try audioSession.setMode(.voiceChat)