AVAudioSessionErrorCodeCannotStartRecording when recording in the background with iOS 13

Hello.


I am working on adding support for iOS 13. Previously the app has been able to record audio for transmition while in the background when the user presses an external button, such as one from a wired headset. This is important as many users such as first responders are currently able to talk by pressing a button, rather than pulling the phone out of a pocket, unlocking it, launching the app etc.


I can't find any sort of recording in the background permission to put in the info plist. Are there any special categories or options needed in the Audio Session to permit this on iOS 13? Failing that, is there a way to launch the app when the user presses the button ( wired or bluetooth le) so the recording can start?


How does the Messages App allow recording on the notification? Inter-App Audio?


Thanks.

Replies

You have to use CallKit to start AudioQueueStart. It works. Tested with 13.4.1

Could you tell me how to use CallKit to start AudioQueueStart? I notie that "Zello" can start recording from background when I use a Bluetooth, and the state on top of screen is green,(my app start recording is red), I don't know how it work. If you have any ideas please tell me, much appreciate.