VmluYXlr
VmluYXlr

Reputation: 11

How to Keep SIP Calls Persistent in Background in Flutter Using flutter_foreground_task?

I'm developing a Flutter application that needs to keep SIP calls persistent even when the app is killed. I've been using the flutter_foreground_task plugin to achieve this, but I'm encountering some issues, especially with video calls. Here's what I've done so far:

Using flutter_foreground_task

The flutter_foreground_task plugin allows creating a background service in a separate isolate from the main/UI isolate. After the user logs in, the background service starts, resulting in two isolates: the UI isolate and the SIP service isolate. Data is sent between these isolates to manage the UI state.

For audio calls, the SIP service isolate sends the following data to the main isolate:

This approach works perfectly for audio calls as the data sent are primitive data types.

But for video calls, I need to send an additional MediaStream object to the main isolate. However, since MediaStream is not a primitive data type, I can't implement video calling using the same method.

Question

How can I keep SIP video calls persistent in the background in a Flutter application? Is there a way to work around the limitation of sending non-primitive data types between isolates, or is there an alternative approach to achieve this?

Upvotes: 0

Views: 73

Answers (0)

Related Questions