Voice disappears when the app is in the background
See original GitHub issueAfter a while the connection is disconnecting while the application is in the background. I’m testing on Android how can i prevent disconnect problem. Please check out this discussion React native discourse group
.
What have I tried so far
I tried to use react-native-backgroundjob for keep app alive but it’s work only short time period like 5-10 minute. I’m really stuck this point.
https://github.com/evollu/react-native-fcm/pull/496 1 i use this and it’s show ongoing notification, but still sound disappears after 20 seconds. I installed the react-native-callkeep library and tried to implement the codes according to the example here https://github.com/wazo-pbx/wazo-react-native-demo but did not work. I’m having trouble understanding this structure because it’s not exactly the same with this sample https://github.com/oney/RCTWebRTCDemo
i think android kills the services we call with ThreadUtils.java .
showLocalNotification(notif) { FCM.presentLocalNotification({ id: new Date().valueOf().toString(), // (optional for instant notification) title:notif.title, // as FCM payload body: notif.body, // as FCM payload (required) show_in_foreground: true , ongoing: true
});
}
pc.onaddstream = function (event) { /…/ RNCallKeep.startCall(this.getCurrentCallId(), null); //Rn callkeep showLocalNotification(notif) /…/ } function leave(socketId) { /…/ RNCallKeep.endCall(this.getCurrentCallId()); this.currentCallId = null; /…/ }
Expected behavior
Sound shouldn’t disappears when the application gets into the background.
Observerd behavior
Sound disappears when the application gets into the background.
Steps to reproduce the problem
Create an app with React-native-webrtc and connect some room after connected get the app to the background
Platform information
- React Native version:0.58.5
- Plugin version:1.69.0
- OS: Android / iOS
- OS version: 6.0.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:13 (4 by maintainers)
Top GitHub Comments
@redexp any idea about the iOS? I am losing audio and connection in iphone. I am connected in the meeting (I implemented that), but audio and video stop transmitting.
any solution ?