react-native-incall-manager icon indicating copy to clipboard operation
react-native-incall-manager copied to clipboard

[Android] - Background Microphone & Camera turning off after 1 minute in Expo Custom-Dev-Client

Open junaiddarajat opened this issue 3 years ago • 2 comments

Preface: I did not need any config-plugins for Expo, just installed it and it runs successfully on both Android & iOS.

I am able to call: InCallManager.start({ media: "video" }); and it's functioning as expected, I've had proximity sensors disabled due to this, and even the Automatic Basic Behavior is functioning as expected.

So, with regards to the issue, foremost it's not really a calling application being made; it's a video conference app, but regardless, everything is functioning as expected however only on Android, once we go to background / lock the screen, after a minute, the outgoing microphone and camera ceases to function, going back to foreground resumes the microphone [but not the camera apparently, might be a related issue]. Clarification: incoming audios are still heard

From what I've read so far, it's to do with Android 11's ForegroundServices, or more specifically, needing ConnectionService for it to function from background. I attempted 'react-native-background-timer' as well to no avail.

Following is my package.json:

        "expo": "^43.0.3",
        "@config-plugins/react-native-webrtc": "^2.0.0",
        "react-native-webrtc": "^1.94.1",
        "react-native-incall-manager": "^3.3.0",

So what sort of solutions can be attempted with this library?

Thanks so much for your time and consideration!

junaiddarajat avatar Jan 10 '22 11:01 junaiddarajat

Using react-native-callkeep with a foreground service allows you to maintain the background audio.

jjsearle avatar Jan 18 '22 15:01 jjsearle

well I just tried that, it works but with other REAL sim-based incoming calls it's a horrible experience and we don't have much control, Is there a direct foreground service just for microphone out there? any libraries for that, be it in react-native or expo?

junaiddarajat avatar Feb 08 '22 11:02 junaiddarajat