简体   繁体   中英

video call acceptance screen with Agora flutter

I'm trying to build a video calling app with Agora , I need to show acceptance screen like WhatsApp when user calling, if the app is exited i need to show calling screen when user is calling, I tried lot of thing but nothing works, I trying to do i flutter and but there is nothing much information on this,Please help me

First things first. You need to learn about some concepts before delving into your solution. Actually there isn't an out of the box solution.

You need to use a couple of things together:

If you want a completely different thing and need to run some background process, there are bunch whole of things you should know first.
I suggest beginning here: https://flutter.dev/docs/development/packages-and-plugins/background-processes

Here is a usefull package to work with background processes that should be constantly running:
https://pub.dev/packages/background_fetch


Currently there are two packages which provides integration for agora.io:

I hope this can help you.

You can try WorkManager plugin.

You can register an call back function to the os when the app is closed.

const myTask = "syncWithTheBackEnd";

void main() {
  Workmanager.initialize(callbackDispatcher);
  Workmanager.registerOneOffTask(
    "1",
    myTask, //This is the value that will be returned in the callbackDispatcher
    initialDelay: Duration(minutes: 5),
    constraints: WorkManagerConstraintConfig(
      requiresCharging: true,
      networkType: NetworkType.connected,
    ),
  );
  runApp(MyApp());
}

void callbackDispatcher() {
  Workmanager.executeTask((task) {
    switch (task) {
      case myTask:
        print("this method was called from native!");
        break;
      case Workmanager.iOSBackgroundTask:
        print("iOS background fetch delegate ran");
        break;
    }

    //Return true when the task executed successfully or not
    return Future.value(true);
  });
}

Maybe this can help you.

The complete article medium article

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM