Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support background modes calling screen #28

Closed
LSmint opened this issue Aug 27, 2019 · 33 comments
Closed

Support background modes calling screen #28

LSmint opened this issue Aug 27, 2019 · 33 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@LSmint
Copy link

LSmint commented Aug 27, 2019

Will Flutter Agora.io support CallKit (iOS) and ConnectionService (Android) in future?

@Matrixbirds
Copy link

Did you mean support remote call through Agora.io cloud service?

@LSmint
Copy link
Author

LSmint commented Aug 27, 2019

@Matrixbirds hopefully having a feature in Agora.io to receive incoming call and launch a call screen when app is in background mode

@Matrixbirds
Copy link

The native SDK still not support this functional. I m already submit this functional proposal to our teammate. If have any progress i will update here.

@Matrixbirds Matrixbirds self-assigned this Sep 7, 2019
@Matrixbirds Matrixbirds added discussion An improvement proposal need discusse enhancement New feature or request labels Sep 7, 2019
@oianmol
Copy link

oianmol commented Apr 12, 2020

Any plans on the integration for the background modes ?

@LichKing-2234 LichKing-2234 added wontfix This will not be worked on and removed discussion An improvement proposal need discusse enhancement New feature or request labels Jun 12, 2020
@LichKing-2234
Copy link
Contributor

we do not support it in Flutter SDK, maybe you can fork our SDK and add it by yourself.

@asongkai
Copy link

Hi,

I need this too if your SDK not support did you recommend any other plugin or tools that works with your SDK?

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Oct 28, 2020

Although we will not integrate Callkit (iOS) and ConnectionService (Android) in the SDK in the near future, if you just want the app to keep calling in the background, you can call setParameters('{"che.audio.opensl":true}'); on the Android platform(>2.3.2), enable Background Modes and select the Audio, Airplay, and Picture in Picture, and Voice over IP options on the IOS platform.

image

@fareesh
Copy link

fareesh commented Dec 22, 2020

Does anyone have a working project with some example code to confirm if this approach is working for Android ?

@mafreud
Copy link

mafreud commented Jan 2, 2021

@LichKing-2234 Where should I put setParameters('{"che.audio.opensl":true}');?
iOS works fine, thanks!!

@zubke
Copy link

zubke commented Jan 29, 2021

For Android there is still an issue in the background. Microphone input is gone when a few minutes in the background. The suggested solution doesn't make a change. So there certainly is a bug. Running the service in a Foreground service would be a solution, but that isn't easy in flutter without changing the plugin itself. I think the solution should come from the agora plugin itself. Are there plans to solve this issue?

@LichKing-2234
Copy link
Contributor

@zubke you can use one of them from pub.dev, you just need to start a foreground service.

@abdullah432
Copy link

abdullah432 commented Feb 23, 2021

@LichKing-2234 Where should I put setParameters('{"che.audio.opensl":true}');?
iOS works fine, thanks!!

How it is working. Can you explain. Did you use a plugin or just "select the Audio, Airplay, and Picture in Picture, and Voice over IP options on the IOS platform." works?

@LichKing-2234
Copy link
Contributor

@abdullah432 should use foreground service on Android, just select the Audio, Airplay, and Picture in Picture, and Voice over IP options on the IOS platform

@JayPerfetto
Copy link

Can you please explain the fix for android beyond "use foreground service"? I understand that is a plugin unrelated to Agora, but if you know how to do it and the rest of us do not, your developers rely on you to communicate clearly how to make this plugin work on all platforms as expected.

@braysonjohn148
Copy link

braysonjohn148 commented Jun 16, 2021

`await FlutterForegroundPlugin.startForegroundService(
        holdWakeLock: true,
        onStarted: () {
          //initialize(); 
        }, 
        title: "",
        content: "",
        iconName: "");`

This is how i implemented foreground_services. When my app is sent to background. It is not killed. I want to know where do i initialize the agora. Where i commented out?? Because i get an error. Initialize this while the other one is not killed.

If u used foreground services succsfully please share this piece of code

@vedartm
Copy link

vedartm commented Jul 14, 2021

@LichKing-2234. I am still not clear with android part. Can you share any code snippet that helps with foreground services. I am not sure if @braysonjohn148 was able to achieve it with his snippet.

@LichKing-2234
Copy link
Contributor

@vedartm you can use the flutter plugin about ForegroundService.

@imyashadulkar
Copy link

Hey, guys do anybody has the proper solution with a repo for running agora or any other voice SDK in the background for android and ios. I checked the whole issue. but couldn't find a proper solution. I need it urgently for my app. Thank you.

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Sep 6, 2021

Although we will not integrate Callkit (iOS) and ConnectionService (Android) in the SDK in the near future, if you just want the app to keep calling in the background, you can call setParameters('{"che.audio.opensl":true}'); on the Android platform(>2.3.2), enable Background Modes and select the Audio, Airplay, and Picture in Picture, and Voice over IP options on the IOS platform.

image

@elaishane Using Background Modes for iOS.
using https://pub.dev/packages/foreground_service for Android.

@Rohithgilla12
Copy link

Rohithgilla12 commented Oct 5, 2021

FYI the foreground service package is not null safe.

@CodingAleCR
Copy link

I have not tried it, but I found this other plugin for foreground services in Android that is null safety compatible: https://pub.dev/packages/flutter_background

@isiyemijoe
Copy link

I'm not sure @LichKing-2234 knows how to implement the foreground service for android he's suggesting, because all everyone need is a simple code snippet, where should we put setParameters('{"che.audio.opensl":true}'); in our code. Pls help if you do.

@isiyemijoe
Copy link

RtcEngine _engine = await RtcEngine.create(
appId,
);
_engine.setParameters('{"che.audio.opensl":true}');

@LichKing-2234
Copy link
Contributor

RtcEngine _engine = await RtcEngine.create( appId, ); _engine.setParameters('{"che.audio.opensl":true}');

this is not helpful, pls use https://pub.dev/packages/foreground_service

@FatimaZahra-FCH
Copy link

FatimaZahra-FCH commented Mar 9, 2022

@LichKing-2234 I tried using foreground_service but I'm having black screen issue both on the local and remote sides

@LichKing-2234
Copy link
Contributor

@FatimaZahra-FCH Could you pls explain your issue?

@FatimaZahra-FCH
Copy link

@LichKing-2234 During a call between 2 devices X and Y, when I turn off the screen of device X and after 1 minute I noticed that the camera view on device Y freezes. (I need to display camera feedback even if the remote device goes into sleep mode.)
Then to solve this problem I tried using the foreground_service you recommended but now the camera view never shows whether its in sleep mode or not (black screen on both devices X and Y)

@LichKing-2234
Copy link
Contributor

if you enable foreground_service, the audio or video capture will keep on background mode.

@FatimaZahra-FCH
Copy link

FatimaZahra-FCH commented Mar 11, 2022

@LichKing-2234 What do you mean by "enabling" foreground_service ?

I'm using this plugin : (https://pub.dev/packages/foreground_service). I moved all the agora related code to the foreground service and I'm using sendToPort() to communicate data between my app and the foreground service and everything is working fine except the black screen issue. I don't have any problem with the audio / RTM / both users are successfully joining the channel .... the only problem is the black camera capture !

Can you please give me an example of how you made it work ?

@jayant1441
Copy link

jayant1441 commented Apr 22, 2022

Did anyone find the solution?

@FatimaZahra-FCH
Copy link

@LichKing-2234 , Still waiting for an answer ...

@Codesait
Copy link

if you enable foreground_service, the audio or video capture will keep on background mode.

It will not be painful to you sir to help out by providing a code snippet solving this issue on background sir

@github-actions
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests