Hello to all,
I’m currently busy adding a chat function to my app and I’m having a bit of trouble with it, since already posted themes about it work with the old ui and the blocks are not the same anymore and I’m not sure how to best solve everything. I want two people to be able to chat with each other. I’m not sure how to solve this in the best way. One idea would be that one can click on a button in the profile of the other and then the screen ‘Chatraum’ opens and the person has to choose a name for the room. When he has done this, he opens a chatroom and can chat with the other person in the screen ‘Chat’. Now I wonder if you can do it this way and if the blocks are oke or if firebase can’t store the data this way. Please note that I am a beginner and have only understood the basic functions. Thanks for any help!
Project url: Thunkable
Firebase should be able to as long as you set it up correctly. It can get a little complicated depending on how youre planning to set it all up. For example are you planning to save ALL chats between both parties forever or just the chats during the current session? You also have to decide who can chat with whom. Is it going to be from a friends list or people in a game and how many people can be in this “chat room”? All of this determines how you are going to setup your firebase. If you can give me some more insight I might be able to help you better.
To add a chat feature you will need to create all the eco-system around it. I have created a chat room that others can join and you can use it as a starting point to do your private chat.
For a private chat to work you will need a list of users available in your app that the chat user can select. Once the user is selected then you can use the same mechanism I used to display chat messages.
The challenge is to manage the data-set in Firebase because you have limited listening capabilities and you will need to listen to any change to notify the other user with new messages.