I am unable to connect bluetooth headphones while the app is backgrounded in iOS 13, iOS 13.1 and iOS 12.4. This was working fine in iOS 12.3 and below.
Steps to reproduce:
1. Configure an app to record in the background. Alternatively, use the Apple built-in "Voice Memos" app.
2. Start the app.
3. Background the app and observe the red pill appearing, indicating that the app is accessing the microphone.
4. Connect Bluetooth headphones.
5. Observe the red pill disappearing and recording stops.
The audio recording should continue seamlessly when a bluetooth device is connected/disconnected.
Is anyone else observing this?
1. If I add some code to restart the audio recording (tearing down and restarting the AVAudioEngine graph) when an audio device is connected, and repeat the above steps, I get the same behaviour but with the following error: