App in background sound disappears WebRTC with Reactnative - javascript

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.
I ask this question here react-native-webrtc but i couldn't implement any solution.
Can anyone please provide a example with https://github.com/oney/RCTWebRTCDemo because i can’t understand exactly how to use react-native-callkeep or an Android ongoing notification.
I tried to use backgroundjob for keep app alive but it's work only short time period like 5-10 minute.

When your app go to background you should always close the webrtc connection due to safety, you can't leave the camera or sound open.
Why you want your app to be alive in background when webrtc is enabled?
Try this repo https://github.com/DimitrisTzimikas/RCTWebRTCDemo2

Related

How can I get Expo scheduled (local) notifications to work while Android device is in doze mode?

so I have created a reminder app using React Native and Expo.
I followed the Expo docs which require that you set your app up with Firebase Cloud Messaging even if you're only sending local, scheduled notifications. I also added the exact alarm permission to the android manifest using app.json. Also, the AndroidImportance for the app's notifications channels is set to MAX. Lastly, the Android priority for the notification itself is also set to MAX, as well.
Everything in the app works great, except for one thing:
When the Android device is inactive for a while, the scheduled notifications do not appear at the scheduled time.
I am assuming this is because the device has entered doze mode which is part of Android's battery optimization features. Doze mode can delay notifications.
I am just surprised-- what is the point of a local, scheduled notification feature if it can't even get past doze mode?
I could be overlooking a solution. Does anyone have any ideas? If not, I may have to rewrite a lot of code so that the notifications are not local.
Thanks!
I first tried setting the notification's priority to high, and the notification still wouldn't appear during inactivity. So then I switched the notification's priority to MAX, and that didn't seem to work either.
There is a package on npm for disabling battery optimization in react native apps, but apparently that can get you banned by google, which I'd rather not get banned.
EDIT: One other relevant detail is that when I was at the stage of development early on where I was testing in the Expo Go app, scheduled, local notifications were not affected by doze mode at all. I'd schedule one in the evening, forget about it, and it would come the next morning. I'm wondering if this as an indicator of what needs changing??
So it turns out there are two places where you can set priority to "Notifications.AndroidNotificationPriority.MAX" --
Once when you send the notification, and once when you handle the notification. I had only set it when sending the notification.
For info go to docs Ctrl + F and search for "AndroidNotificationPriority"

How to stream both pc sound and incoming sound over a network

Hey guys am trying to create a streaming system using javascript where the system can receive both sound playing from my pc and sound entering my pc like a mic and then streaming both sounds live on the browser allowing multiple users listen to it. this is more like a radio brocasting session where you can play sound and also talk same time and the listener gets both sound without any latency or if any it shouldn't be noticed at all is this possible to be achieve using javascript - node js and react? if yes any guide at all with help thank you.

Keep alive webRTC audio stream on Android

I have built a webRTC application that streams audio.
The application works as intended on all devices and the client is able to hear the audio stream. At a very high level, the RTC stream is simply attached to an audio element which works great.
The problem: I am trying to utilize the Android Chrome background audio feature. At the moment the stream keeps playing in the background (even when chrome is minimized) however about 5 seconds after screen timeout/lock, the peer connection is closed. This is not a memory issue (I have several test devices including a Galaxy S7).
In contrast if I simply point to url of an mp3 file, the audio context will keep playing indefinitely. Is there a way to achieve this indefinite background with a webRTC stream?
Cheers in advance!
Looks like this old bug made its way back into Chromium :
https://bugs.chromium.org/p/chromium/issues/detail?id=951418
Verified resolved in issue 513633 with no background logic required: https://bugs.chromium.org/p/chromium/issues/detail?id=513633

Notification from web app (Android)

I'm developing a web app that shows a counter, and when the counter comes down to 0 I want to notify the user(The counter is on a server, so there won't be a problem with reloading the page).
If the user is on a computer, I'm using a popup for the notification, but if the user is on an Android device, I would like the notification to be shown even if the browser isn't open.(I'm using AngularJS if that would be any help)
Is there a way to do this? I rather not build a special Android app.
Thanks.
//G
I'm afraid no, there is no way to do that. When any android application is not active is... not active, frozen. The browser is not a service, so as far as I know it won't process anything while in background. Even it's possible the OS close the browser if it needs more memory than is available.

Jquery Mobile, How to restart an App

I'm writing a mobile App with HTML5 and Javascript. I'm using also jquery.
So my question is. Is there a way to restart a App ?
Want i want is. If my App works in online modus and lose the connection to the internet, the app should restart and change to the offline modus.
Hope U understand me.
I'm also open for other ideas.
If when you attempt to get or post a request to your server and it fails and gives you a connection error you can just navigate back to your first page and clear out all your stored variables. Create a function like
function reset_app(){
$.mobile.changePage('#first_page');
global_vars = default_global_vars;
}
its so simple
go to mob task manager and touch the icon of Restart....jquery mobile

Categories

Resources