简体   繁体   English

带有 Agora flutter 的视频通话接受屏幕

[英]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我正在尝试使用Agora构建一个视频通话应用程序,我需要在用户通话时显示像 WhatsApp 这样的接受屏幕,如果应用程序退出我需要在用户通话时显示通话屏幕,我尝试了很多东西但没有任何效果,我试图做我 flutter 但没有太多关于此的信息,请帮助我

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我建议从这里开始: 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:这是一个有用的 package 与应该不断运行的后台进程一起工作:
https://pub.dev/packages/background_fetch https://pub.dev/packages/background_fetch


Currently there are two packages which provides integration for agora.io:目前有两个包为 agora.io 提供集成:

I hope this can help you.我希望这可以帮助你。

You can try WorkManager plugin.你可以试试WorkManager插件。

You can register an call back function to the os when the app is closed.您可以在应用关闭时向操作系统注册回调 function。

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全篇中篇

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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