3 ms·
A very simple way is by having the app listen to a Firebase JSON object via a websocket. Whenever the contents (of the "chatroom") change, the new text is pushe
by dtagames 4y ago
A very simple way is by having the app listen to a Firebase JSON object via a websocket. Whenever the contents (of the "chatroom") change, the new text is pushed down to all users in the room.
In fact, this was the original use case for Firebase, which was first released as a tool for building in-app chats.
- dekervin 4y agoInteresting. Does that mean each user is its own chat room ? Will there be some drawbacks to that approach?
- dtagames 4y agoThe room is just a JSON object, too (or a "path" down inside one), so anyone you want can be in the room. If only two people are listening to that object, it would look like private messaging. If everyone were listening to a room, it would appear "public." The disadvantage is that you have to build it. It's easy, so I'd say that's really an advantage because you will deeply understand it. NoSQL data and websockets are really important technologies and Firebase is free, including hosting, until you hit some pretty high usage limits.