I start a VoIP call using CallKit, use AVAudioSession.sharedInstance.overrideOutputAudioPort(.speaker)
to force the audio to speaker, and then open an AVRoutePickerView
.
The selected output in the view is iPhone
-- the ear speaker on the iPhone. I would expect it to show instead that speaker
is selected.
What could be causing this? Should I be forcing the output to the speaker in a different way? Is there a different way I can expose the route choosing functionality?
What's strange is that if you lock the phone and look at the CallKit UI, it shows that it is routing to speaker