Okay
And how about user online status?
what kind of system design do you have in place? is one chat a document? or somethin
You could use the User Preferences for this
So when a user opens the app, change the 'isOnline' preference to true
, and vice versa
Okay I will explain,
I have a list of friends, so any two people can have a conversation and so the conversation id is unique to these two people only.
On a chatting screen, when this two people are texting, i save messages with this unique conversation id
and each conversation is a document?
Yes
Would you like to have a look?
okay and how do you save the messages? Is it as a JSON object or something?
Aaaaaaa messages are in a collection as a document
Has attributes
okay i guess it wold be better if you showed me your full database structure.
Yes sure
Can I call you, to screen share?
I'd prefer if you can send screenshots or a video recording. I cant hop on a call right now.
okay sure
Tha kyou. But how do i update when I do offline suddenly?
Check out this package on pub: https://pub.dev/packages/flutter_fgbg
If the app is on the foreground, it's being used which means a user is online. If it's in the background, it is not being used so user is offline.
Thankyou Mr.Safwan
@Nuaiman Does that solves your issue?
@D5 couldnt try yet, my pc died on me. Waiting for it to get fixed
Recommended threads
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...
- 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...