Unable to trigger AudioRecordingIntent from background

I am building an app where I am using AudioRecordingIntent to start audio recording from shortcuts / Action button etc. Whenever I set that up, I notice that I get an error -

Unknown NSError Live Activity start failed: The operation couldn’t be completed. Target is not foreground

I explicitly try to start the live activity and then start the audio recording and that's when I see this error.

How can I make this work? I am unable to find any examples.

Hi there,

The error you are seeing is actually expected behavior due to iOS privacy and security restrictions. Apple strictly prevents apps from initiating an AVAudioSession for recording from a completely backgrounded state.

Because of these privacy constraints, you cannot start an audio recording from scratch using an intent (like via a Shortcut or the Action Button) if the app isn't already active.

How to make this work: To use an AudioRecordingIntent alongside a Live Activity, the recording session must originally be initiated while the app is in the foreground. Once the session is running and the user backgrounds the app, you can then manage it:

Pause and Resume: You can manually pause the recording from the background using a button on your Live Activity. Once paused, you can use an intent triggered from the Live Activity to resume the recording.

System Interruptions: If your active background recording is interrupted by the OS (e.g., an incoming phone call, an alarm, or Siri), you can provide a button on the Live Activity powered by an intent to let the user resume the recording once the interruption ends.

In short: The initial trigger to start the recording must happen in-app. The Live Activity and its Intents can only be used to manage (pause/resume) an already established session, rather than launching a new one from a cold background state.

Unable to trigger AudioRecordingIntent from background
 
 
Q