As you can see, none of them actually saves the chat to Firebase. You only save the last input message to cloud variable Send_ChaT and what is showing on the screen is the result of cloning the screen components only.
So I think that the ‘SAVE’ should come in the second blocking,after save is done_then the cloning should take place??
Or can it be at the click of the SEND_CHAT BUTTON?
For a room chat, your Firebase database structure could be:-
Chat-DB
chat-Room
Room-Code
Message-List
Date-Stamp( as message ID)
Sender
Message-Text
You will need to save every message under the correct key.
When any user runs the app and enters the room code, you should read your Firebase and display the chat messages under that room before giving the user the ability to send his/her own message.
Am so confused right now,which and which are actually Variables,can you please just shed more light on how to go about this structures you’ve pointed out…
Thanks for the rescue
I noticed a bug in the project that it duplicates the chat history with every new entry. This is now fixed. You can remix the project again to get the updated copy.
To use it properly you will need to add a procedure/function to check the the nickname/ID entered is not already used.
I made more changes but cosmetic only. Now the caption of the chat page shows the chat room name and the user name. Another change is that if the message is yours then it shows without name because you are the only one showing in the lift side. All others will show the message with the name.
The caption will now notify other users when a new user comes in ,and another label to display number of users online…
These are other features am trying to include now…
Oh, sorry, I thought you are the one started the topic from the way you are running after the solution. Now I see that @domhnallohanlon is the owner of this topic.
Good luck. These are the features I call cosmetics.