Nuaiman
Hello Appwriters,
I want to implement a chat feature in my app. I will describe the scenario down below.
- Chat can only be started from a post. Example - you are scrolling a facebook post and you can starting chatting with the post publisher only. So, bacially in the post there is a button that lets you chat with the postOwner.
- After you start the chat, you can access that chat from a ChatList screen.
- The chat should have a message seen or unseen feature.
Please help me designing this system, I have been unable to achieve it own my own.
Thankyou and best regards.
TL;DR
1) Use Appwrite's authentication services for user registration and login. Associate user accounts with the chat functionality.
2) Store chat data using Appwrite's Database service. Create a collection for chat messages and related information.
3) Create a new chat room or retrieve an existing one based on the post owner's ID when a user clicks the chat button on a post.
4) Develop a ChatList screen to display ongoing chats. Fetch chat data from Appwrite's Database and display relevant details.
5) Implement a message seen/unseen feature by storing messages with an initial status of "unseen" and updating the status to "seen" joeyouss
Hi
joeyouss
- User Registration and Authentication:
- Use Appwrite's authentication services to handle user registration and login.
- Once a user is logged in, you can associate their account with the chat functionality.
- Storing Chat Data:
- Utilize Appwrite's Database service to store chat-related data, such as messages, chat participants, and message status (seen/unseen).
- Create a collection to store chat messages and related information.
- Initiating a Chat from a Post:
- When a user clicks the chat button on a post, trigger a function in your app that creates a new chat room or retrieves an existing one based on the post owner's ID.
- Store the necessary information, such as the chat room ID, in your database.
- Displaying ChatList:
- Develop a ChatList screen in your app to display all ongoing chats.
- Fetch the chat data from Appwrite's Database using appropriate queries or functions.
- Display the chat rooms and relevant details in the ChatList screen.
- Implementing Message Seen/Unseen Feature:
- When a user sends a message, store it in the chat room's collection with the initial status as "unseen".
- When the recipient views the message, update its status to "seen" in the database.
- To keep track of the seen/unseen status, you can utilize a field or attribute in the message document.
Recommended threads
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...