title: Firebase chat app setValue failed error with a public database?
body: <p>I have a chat app using Firebase that keeps on having a</p>
  
  <blockquote>
    <p>setValue at x failed: DatabaseError: permission denied</p>
  </blockquote>
  
  <p>error every time I type a message.</p>
  
  <p>I set my Database to be public already:</p>
  
  <pre><code>service cloud.firestore {
    match /databases/{database}/documents {
      match /{allPaths=**} {
        allow read, write: if request.auth.uid != null;
      }
    }
  }
  </code></pre>
  
  <p>Is it something from within my chat reference?</p>
  
  <pre><code>private void displayChat() {
  
      ListView listOfMessage = findViewById(R.id.list_of_message);
  
      Query query = FirebaseDatabase.getInstance().getReference();
      FirebaseListOptions&lt;Chat&gt; options = new FirebaseListOptions.Builder&lt;Chat&gt;()
              .setLayout(R.layout.list_item)
              .setQuery(query, Chat.class)
              .build();
  
      adapter = new FirebaseListAdapter&lt;Chat&gt;(options) {
          @Override
          protected void populateView(View v, Chat model, int position) {
              //Get reference to the views of list_item.xml
              TextView messageText, messageUser, messageTime;
              messageText = v.findViewById(R.id.message_text);
              messageUser = v.findViewById(R.id.message_user);
              messageTime = v.findViewById(R.id.message_time);
  
              messageText.setText(model.getMessageText());
              messageUser.setText(model.getMessageUser());
              messageTime.setText(DateFormat.format("dd-MM-yyyy (HH:mm:ss)", model.getMessageTime()));
          }
      };
      listOfMessage.setAdapter(adapter);
  }
  </code></pre>