1 00:00:00,840 --> 00:00:03,520 This is a quick fix for a hobby project such as this one. 2 00:00:03,520 --> 00:00:06,650 But I wanted to make it a separate video since it's incredibly important to 3 00:00:06,650 --> 00:00:09,270 call out that this fix is just that. 4 00:00:09,270 --> 00:00:11,850 Only to be used in hobby projects. 5 00:00:11,850 --> 00:00:15,220 Firebase requires you to have rules on your real time database. 6 00:00:15,220 --> 00:00:18,940 By default, the rules require user authentication before you can read and 7 00:00:18,940 --> 00:00:20,570 write to the database. 8 00:00:20,570 --> 00:00:23,610 Since we aren't going to authenticate users in this small project, 9 00:00:23,610 --> 00:00:28,080 we'll simply scrap the default rules, and set read and write to true. 10 00:00:28,080 --> 00:00:32,295 To do this, we'll navigate to our Projects database, and then click the Rules tab. 11 00:00:34,580 --> 00:00:38,157 Then, replace the current rules with just the word true. 12 00:00:41,702 --> 00:00:43,990 Finally, click Publish. 13 00:00:43,990 --> 00:00:45,180 You'll see a warning here, but 14 00:00:45,180 --> 00:00:48,195 it's safe to ignore it, again, just in hobby projects. 15 00:00:48,195 --> 00:00:52,040 You'll want to update these rules and production applications, 16 00:00:52,040 --> 00:00:56,120 as you should more than likely always have some form of user authentication. 17 00:00:56,120 --> 00:00:59,220 Please see the teacher's note for more information on how Firebase rules work. 18 00:01:00,330 --> 00:01:03,590 Now that we have made this quick fix that you should only ever make for 19 00:01:03,590 --> 00:01:06,660 small hobby projects, let's go check out our application again. 20 00:01:07,690 --> 00:01:11,870 I'll pull up my emulator side by side with my database from the Firebase console. 21 00:01:11,870 --> 00:01:16,180 Now, when I attempt to send a message, it actually appears in the database. 22 00:01:16,180 --> 00:01:19,067 I hope you didn't blink, because if you did you probably missed it. 23 00:01:22,864 --> 00:01:23,600 Awesome! 24 00:01:23,600 --> 00:01:25,660 We've got messages posting to Firebase, but 25 00:01:25,660 --> 00:01:27,910 why aren't they showing up in our application yet? 26 00:01:27,910 --> 00:01:31,900 Well, we're currently not listening for any changes in the real time database. 27 00:01:31,900 --> 00:01:33,440 In order to receive those changes, 28 00:01:33,440 --> 00:01:36,350 we're going to learn about Child Event Listeners, and how we can use them to 29 00:01:36,350 --> 00:01:39,490 receive a callback when someone adds a message to our messages node