使用公共數(shù)據(jù)庫(kù)的Firebase聊天應(yīng)用setValue失敗錯(cuò)誤?我有一個(gè)使用Firebase的聊天應(yīng)用程序,它繼續(xù)使用x處的setValue失?。篋atabaseError:權(quán)限被拒絕每次輸入消息時(shí)都會(huì)出錯(cuò)。我已將數(shù)據(jù)庫(kù)設(shè)置為公開(kāi):service cloud.firestore {
match /databases/{database}/documents {
match /{allPaths=**} {
allow read, write: if request.auth.uid != null;
}
}}這是我的聊天參考內(nèi)容嗎?private void displayChat() {
ListView listOfMessage = findViewById(R.id.list_of_message);
Query query = FirebaseDatabase.getInstance().getReference();
FirebaseListOptions<Chat> options = new FirebaseListOptions.Builder<Chat>()
.setLayout(R.layout.list_item)
.setQuery(query, Chat.class)
.build();
adapter = new FirebaseListAdapter<Chat>(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);}
使用公共數(shù)據(jù)庫(kù)的Firebase聊天應(yīng)用setValue失敗錯(cuò)誤?
狐的傳說(shuō)
2019-07-27 19:54:09