come online again a web socket connection is made
And the messages which was sent when the user was offline will be send to user
So when should I send those messages, should I let the user send any timestamp requesting that they want messages after this timestamp? Or the server send upon the socket connection
If that’s the case then for multi login I won’t get the messages in other phone
If i want to send the timestamp, then I need to send the timestamp of all the chats and get the message
Is there any other method to do this ?
Websocket for realtime events, pull for historic events.
You mean a normal http rest api to get old messages ?
Yes. You keep the realtime code seperated from historic events. The client can listen for current events and the server can query the messages from the database in the background.
But I want to first show all the old messages and then the new messages
Обсуждают сегодня