I had a webrtc connection that’s works fine when app is in foreground , but when app is in background the audio disconnect.
I believe i am missing something as it works in a lot of voip apps with no special permission
I read about schedule a background task but i think this is meant to execute something periodic ever x minutes , not to handle a call
2
Answers
You need to add an VoIP capability to maintain a connection in the background. See the Signing & Capabilities pane in you app configuration, select Background modes, and enable "Voice over IP."
That said, I recommend exploring the full documentation on handling VoIP via CallKit. You’ll generally want more than just enabling a background mode.
You may need to use CallKit to pass the call information to the system.
There are some packages
that try to deal with this issue, but you may need to adapt it to your own needs, e.g. by forking or getting some inspiration from their implementation (maybe this article will help) if that doesn’t match your use case. In the past I implemented VoIP calling app with Flutter and I had to use CallKit manually in Swift.