iOS Bluetooth output + phone microphone input problem


somehow I cannot get the Bluetooth output + phone mic input routing to work (tested with iPhone XR + iOS 13).

I’m pretty sure it has worked before, and it should still be possible. I downloaded a microphone app from App Store and it allows to route the audio output to a BT speaker while using the phone mic as the input. Works great.

According to docs I should use session category AVAudioSessionCategoryPlayAndRecord with option AVAudioSessionCategoryOptionAllowBluetoothA2DP. However, after I do this the Bluetooth device disappears after several route change events and the output is routed to speaker.

Any ideas?