C
C#13h ago
Kratos

Building a Chat App with Firebase in .NET MAUI – Any Examples or Guides?

Has anyone tried to build a chat app using Firebase in .NET MAUI? I've already implemented authentication (login/register) with Firebase, but I'm facing some obstacles in setting up the chat functionality. Are there any examples or guides on how to implement it? I haven't found similar projects on GitHub. Any help would be greatly appreciated!
No description
5 Replies
Askeladd
Askeladd13h ago
message table : user1 user2 text time chat table : user1 user2 lastMsg chat <1---*> message and you view messages that have same user1 user1 as chat
Kratos
KratosOP12h ago
Thanks for the suggestion! I’ve already implemented the chat feature, and it stores the message history for one user. However, right now, all users can see the chat history. I’m not sure how to proceed so that each user has their own private chat with another user, without it being visible to others. It seems a bit complicated since this is my first time building something like this. Any advice on how to set this up properly?
No description
Askeladd
Askeladd12h ago
{
"rules": {
"chats": {
"$chatId": {
".read": "request.auth != null && resource.data.users[request.auth.uid] == true",
".write": "request.auth != null && resource.data.users[request.auth.uid] == true"
}
}
}
}
{
"rules": {
"chats": {
"$chatId": {
".read": "request.auth != null && resource.data.users[request.auth.uid] == true",
".write": "request.auth != null && resource.data.users[request.auth.uid] == true"
}
}
}
}
i made it before with flutterflow so i didn't write any code actually but you can try this it should help with accessing chats and you should edit it in your code to only show chats with authenticated user id
Kratos
KratosOP12h ago
Thanks for the suggestion! I get it now—these rules make sure that only the users involved in a chat can read and send messages. I’ll give adding these rules to my Firebase security settings a try and see how it goes. Really appreciate the help!
Askeladd
Askeladd12h ago
np man good luck

Did you find this page helpful?