Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Background recording app getting killed by watch dog.. how to avoid?

We have the necessary background recording entitlements, and for many users... do not run into any issues.

However, there is a subset of users that routinely get recordings ending.. we have narrowed this down and believe it to be the work of the watch dog.

First we removed the entire view hierarchy when app is backgrounded. There is just 'Text("Recording")'

This got the CPU usage in profiler down to 0%. We saw massive improvements to recording success rate.

We walked away assuming that was enough. However we are still seeing the same sort of crashes. All in the background. We're using Observation to drive audio state changes to a Live Activity.

Are those Observations causing the problem? Why doesn't apple provide a better API to background audio? The internet is full of weird issues

https://stackoverflow.com/questions/76010213/why-is-my-react-native-app-sometimes-terminated-in-the-background-while-tracking

https://stackoverflow.com/questions/71656047/why-is-my-react-native-app-terminating-in-the-background-while-recording-ios-r

https://github.com/expo/expo/issues/16807

This is such a terrible user experience. And we have very little visibility into what is happening and why.

No where in apple documentation states that in order for background recording to work, the app can only be 'Text("Recording")'

It does not outline a CPU or memory threshold. It just kills us.

Hello @bryan1anderson, thank you for your post. There are many reasons why audio may be interrupted when an app is in the background. Are you registering for the interruptionNotification, the routeChangeNotification and the mediaServicesWereResetNotification, and handling them?

mediaServicesWereResetNotification is the only one we're not handling

Background recording app getting killed by watch dog.. how to avoid?
 
 
Q