getUserMedia not working in background for UIWebView

I have a React website that uses getUserMedia to capture user audio. I'm displaying this website in an iOS mobile app using UIWebView in SwiftUI. The audio is correctly captured when the app is in focus. However, when the app goes to the home screen and runs in the background, the microphone audio gets cut off. This issue does not occur when the website is opened in iOS Safari.

Here's my Info.plist and .entitlements file. I granted most, if not all, permissions for both files in an attempt to get it to work, but it still doesn't resolve the issue.

Info.plist

  • audio
  • bluetooth-central
  • bluetooth-peripheral
  • external-accessory
  • fetch
  • location
  • nearby-interaction
  • processing
  • push-to-talk
  • remote-notification
  • voip

Entitlements.plist

  • com.apple.developer.push-to-talk: true
  • com.apple.developer.spatial-audio.profile-access: true
  • inter-app-audio: true
getUserMedia not working in background for UIWebView
 
 
Q