video call acceptance screen with Agora flutter
Asked Answered
O

2

5

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

Ogren answered 27/4, 2020 at 14:10 Comment(7)
You may start searching for concepts like "How to start activities from the background". From what I could understand in the question, the problem might be about restrictions doing that (developer.android.com/guide/components/activities/…). I recommend you explaining more and adding code in your question: AndroidManifest.xml permissions, Activities used, the foreground Service you may have to be running, etc.Surra
i have tried several codes,nothig seems to work,i need to everything in flutter,the app is also for ios,i need something universal,so that i don't have write everything in native @SurraOgren
What part are you struggling with?Sihunn
starting an activity from service, when screen is locked and or app is terminated /backgroundWhidah
I've developed a voip app. For ios we use callkit but for android we issue a notification for an incoming call. The user clicks on the notification launching the app. This paradigm then works whether the screen is turned off or locked.Disunity
@Disunity what about popular video calling apps which show incoming call screen even if screen is lockedWhidah
@joyBlanks apple makes this easy with CallKit. Android less so. I know Samsung has their own thing but I haven't yet figured out a similar thing in Android that works across all flavors so we go with the notification paradigm I mentioned earlier.Disunity
G
20

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.

Greatgranduncle answered 20/8, 2020 at 16:13 Comment(2)
hi will you provide some code of this.Harlene
We have implemented the CallKeep package for Agora: github.com/Clinica-Mongolia/callkeep_agoraHeredia
B
0

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

Burkhard answered 14/8, 2020 at 11:19 Comment(1)
looking for a fullscreen activity like incoming call screen when app is terminated/inbackground and screen may or mayn't be lockedWhidah

© 2022 - 2024 — McMap. All rights reserved.