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.

I am only able to start recording in the background after an interruption (if I was already recording before the interruption started). Otherwise, it's blocked (I'm assuming for security/privacy reasons).

>not an answer to your specific question but this looks like a "crime"

I totally agree but it is the solution currently suggested to us by Apple.


It is of very ugly and annoying for the user - to the point of unacceptable for most users I believe.


But now after our battery tests it also proves that this is a huge waste of battery life also likely unacceptable to most users.

And to record sound continiously just to trash it just feel like crazy.

Oh thanks for the response @nevos.


We dont want to record until the user activates our bluetooth accessory so this will not work for us unfortunately.

Guess we are back at square one and there is still no way forward for this

@k.alonso have you got any more info from Apple? I have not received a reply for almost a week now. Anyone else got any new info?

a variation of the same issue:


go to apple's voice memos app. start recording, switch to background

the red recording indication is shown - if you tap it - it brings you to the voice memos app.

now, switch to background and do anything that plays a sound.

e.g. go to settings > sounds and change ring volume or ring tone - that will play a sound.

the red recording indication is still shown but mic no longer records.

if you tap the red recording indicator no longer it brings you back to the voice memos app and if you go to the voice memos app you see that recording is actually stuck.

Does this work out?


I tried your method(callkit ),but nothing happen.

Hello,


@Apple: Is there any fix for the iOS 12.4 for this issue?

Still I'm facing same issue ios13.2, does any one found soplution ?

looks like a "cold case" bug

No :-(

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.

AVAudioSessionErrorCodeCannotStartRecording when recording in the background with iOS 13
 
 
Q