At this point, we have an initial structure for our groups. Now, we need each of the group entries to contain a list of messages. We don't have support for posting messages to the server, so let's update the database directly and provide some dummy data for one of the groups. We will replace this dummy data with real messages later in this chapter. Let's get started:
- Switch to the Firebase console and provide the messages object for the root entry, as shown in the following screenshot:
As you can see, we are keeping the data in separate branches to simplify real-time access. The groups branch contains information about the chat groups, while the messages branch stores the actual user messages. Each message object has a reference to the group. This is a very minimalistic implementation and is purely for demonstration purposes.
- Now, it...