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
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.