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.