question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Voice disappears when the app is in the background

See original GitHub issue

After 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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
callmemonkycommented, Feb 23, 2021

@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.

0reactions
kkurelicommented, Jun 29, 2021

any solution ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

App in background sound disappears - React Native WebRTC
I've used it globally and the app has worked in background without a problem for 40+ minutes while the phone was in charge...
Read more >
Vocals fading into the background and disappearing
First, consider whether this happens with streamed or downloaded content. If the content is streamed, try downloading the songs to test the ...
Read more >
App in background sound disappears WebRTC with Reactnative
When your app go to background you should always close the webrtc connection due to safety, you can't leave the camera or sound...
Read more >
How do I stop Windows from muting background applications?
But that's not Windows muting them, it's just that the apps stop playing. Easy test: If you open a video in your browser,...
Read more >
Audio recording settings window disappeared
I've restarted and reset and have the microphone recording in Voice recorder, but now I get the hiss and background noise I could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found