AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
625 stars 227 forks source link

Android: Capture audio in background (Foreground service) #807

Closed jfbourne closed 1 week ago

jfbourne commented 2 months ago

Describe the bug The application stops getting audio from the microphone if it is put in the background.

To Reproduce Steps to reproduce the behavior:

  1. Join a Voice Calling call
  2. Put the application in the background
  3. Wait about 5s
  4. The other user doesn't hear you

Expected behavior The app continues to function when in the background

Smartphone (please complete the following information):

Additional context I already trying adding <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> to the manifest and added setParameters('{"che.audio.opensl":true}'); to the engine but it does not work.

guoxianzhe commented 2 months ago

https://docs.agora.io/en/help/quality-issues/android_background @jfbourne pls check here

jfbourne commented 2 months ago

@guoxianzhe thanks. I did came across that post but, that means I have to implement some android native code and bridge that back to react-native. I’m want to see if agora-react-native already implements some solution that won’t require the community to write custom native code.

guoxianzhe commented 2 months ago

@jfbourne understood, We will consider it.

stale[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.