setOutputMode
In Android one can switch between handset and speakerphone by calling AudioDeviceManager.getAudioDevice().setOutputMode. However, in iOS this requires using a custom audio driver. Why isn't this implemented in the iOS SDK similar to the Android SDK?
Were you able to find a better alternative?
There is no alternative. Just half implemented SDK.
Does changing the AVAudioSession category not work? https://developer.apple.com/documentation/avfaudio/avaudiosession/categoryoptions/1616462-defaulttospeaker
It only does if you add a delay between subscriber stream connected and setting the category with options excluding defaultToSpeaker.
I have had similar issues, I believe it is a limitation on the AVAudioSession side. You can try setting the audiosession to active before hand