As per our client need in mobile application the Publisher needs to initiate the session and show the text chat first and same as when a Subscriber joins the session, he starts with the text chat. If the subscriber wants to start & join video chat, he can ask the publisher and starts the video chat once publisher accepts & started.
Now the issue is if the Publisher initiates the session & press home button. App does not gets internet service, due to this the session disconnects after few auto reconnecting try outs.
So we planned to re-initiate the same session with same session id & token, once the Publisher resumes the app.
In this latest sample app (https://github.com/opentok/accelerator-sample-apps-android) we could not able to re-initiate the session. But in the previous example with the following package compile 'com.opentok.android:accelerator-pack:+' we can achieve connecting to session, But the text chat session is not connecting.
Please guide me. Thanks in advance.
Push HOME button should not cut internet connection. Actually, normal behaviour is to keep audio streaming so you have to mute it on onPause()
If you are suffering disconnections for any reason and you can't solve it, you should not try to reuse a session. It is recommended to create a new one.
Related
I have an education app that written by node.js and express.js
I want to show user status(online or offline) side profile photo
How can do it???
Using socket.io is a good choice here: https://socket.io.
Once a user logs in successfully, you can emit an event to broadcast to everybody else that he is online. Similarly, when the user logs out, you can emit another event to broadcast to everybody else that he went offline. (Also when he closes the browser without logging out properly).
Using socketio you can emit and listen to events between the client and the server. You can broadcast events to multiple clients, you can add clients to rooms and broadcast events specifically to the clients in the room, and do a whole lot of things!
Good luck.
I am trying to implement private messaging with socket.io for my mobile applications which have a direct messaging feature like Instagram. Right now, I am using Node.js and React Native. I am kinda new to socket.io. I saw many examples of that. However, one thing is not clear in my mind.
User clicks "send message" button. Then I create a socket connection and the user joins a room with socket id. Then user sends a message to that room.
The problem here is, how other user will get the message? Because at this point, I don't think other user knows the room id. Of course if there is a better solution for that, I am open to every suggestion.
One thing you can do is create a room for each person. When the person logs into your app and connects with socket.io, you'll want to have them automatically join the room with their user id.
Then when someone wants to send them a message, they can just send the message to the room for the receiving user.
However, I think if you are building a messaging app, socket.io is not the right way to go. As far as I know you can't listen on sockets while the app is in the background (and even if you could, it would drain your users' battery life). You should use push notifications instead and use the data field (e.g. zo0r/react-native-push-notification and firebase).
I am creating a customer support bot using Ms botframework v4 with nodeJS and directline API 3.0. A customer would talk to the bot and on request, the conversation would be handed over to an agent. If the customer requested to talk to a bot, the customer will wait until the agent becomes available. I want to check if the customer is still active before the agent sends a message to him/her.
wireframe of the bot and the webiste As you can see in the image Jack is in the queue I want to find out a way to check if Jack is still waiting, or he close the window and no longer waiting.
Check out this SO solution I provided. The request is similar to yours in that the OP wants to know how the bot can be notified if a user exits.
The short answer is to use an event listener. Before the window (that houses the web chat instance) is closed, an event is fired. This event is picked up by web chat which sends an activity (message, event, or other) to notify that bot.
From this point, you simply need to forward the notification to the agent that the user has exited the conversation.
Hope of help!
I am learning PubNub and building real time applications with PubNub
PubNub's new debug console allows me to connect several test clients to a channel of my choice - this is cool!
I notice that the debug console has a user named "Console_Admin" that subscribes to the channel. This user stays on the channel even when all test clients have unsubscribed and exited. This user appears to stay even when a new session is started with the Debug console.
I know this since I have another client running on my local machine that is listening to Presence events on the same channel. And the Console_Admin user has not left the channel, despite me having started a "New Session" on the Debug console
Does "Console_Admin" ever unsubscribe from the test channel? Is there a way I can have it unsubscribe?
It appears that eventually the "Console_Admin" user does unsubscribe from the channel
After a while when I logged back on the channel from my local NodeJS client, the occupancy was down to 1 (indicating my local NodeJS client was the only one around)
The new PubNub Debug Console probably has some sort of 'lazy unsubscribe' for the Console_Admin users
I am new to node.js and trying to develop group chat using node.js and socket.io. I am able to do group chat also able to manage data in the system.
Now, the problem with me is with offline users i.e not connected to internet.
I am having connection stream of this user and as if I do receiverUserSocket.emit("sendMsg",data) there is no way to verify if this user received message or not.
Yes, there is an event .on("disconnect") but I am getting delay of approx 30 - 40 seconds.
Is there any way we can identify that the user to whom we want to send message is online or offline.
The best way is to use socket.io heartbeats - assuming you're using socket.io.
Heartbeats and the problem with detecting a terminated connection are well explained here:
Advantage/disadvantage of using socketio heartbeats
Keep in mind that you can control heartbeat timeout values (thus forcing the disconnect event to appear much faster), as explained here:
Controlling the heartbeat timeout from the client in socket.io
But that might put much more strain on your server.