How to record audio in background

How can i record an audio when the app is in background? I tried on android and its working but on IOS its only recording on the foreground

Its an Expo app and am using Expo Av library

I have already allowed the permissions and set the UIBackgroundModes with audio

"infoPlist": { ... "UIBackgroundModes": [ "audio" ] }

And in the code also

await Audio.setAudioModeAsync({ allowsRecordingIOS: true, playsInSilentModeIOS: true, staysActiveInBackground:true });

but once the app is in background mode it is failing to start recording. Can anyone help me how I can fix this ?

Post not yet marked as solved Up vote post of Santinal Down vote post of Santinal
542 views