Back

Online & Typing status for chat app

  • 0
  • Flutter
  • Databases
  • Storage
  • Cloud
  • Realtime
Nuaiman
6 Aug, 2023, 08:21

Okay

TL;DR
The user is asking for help with implementing an online and typing status for a chat app. They mention that their PC is currently not working. There is a suggestion to use a package called flutter_fgbg for determining online and offline status. The user asks how to update the status when they go offline suddenly. There is a mention of screenshots or video recording for troubleshooting. The user suggests screen sharing via a call. There is a discussion about the database structure and saving messages. The suggestion is made to use User Preferences for determining online status. The user asks about the system design and how to handle user online status. The solution is not provided
Nuaiman
6 Aug, 2023, 08:21

And how about user online status?

safwan
6 Aug, 2023, 08:22

what kind of system design do you have in place? is one chat a document? or somethin

safwan
6 Aug, 2023, 08:22

You could use the User Preferences for this

safwan
6 Aug, 2023, 08:23

So when a user opens the app, change the 'isOnline' preference to true, and vice versa

Nuaiman
6 Aug, 2023, 08:23

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

safwan
6 Aug, 2023, 08:24

and each conversation is a document?

Nuaiman
6 Aug, 2023, 08:24

Yes

Nuaiman
6 Aug, 2023, 08:24

Would you like to have a look?

safwan
6 Aug, 2023, 08:24

okay and how do you save the messages? Is it as a JSON object or something?

Nuaiman
6 Aug, 2023, 08:25

Aaaaaaa messages are in a collection as a document

Nuaiman
6 Aug, 2023, 08:25

Has attributes

safwan
6 Aug, 2023, 08:25

okay i guess it wold be better if you showed me your full database structure.

Nuaiman
6 Aug, 2023, 08:25

Yes sure

Nuaiman
6 Aug, 2023, 08:25

Can I call you, to screen share?

safwan
6 Aug, 2023, 08:26

I'd prefer if you can send screenshots or a video recording. I cant hop on a call right now.

Nuaiman
6 Aug, 2023, 08:26

okay sure

Nuaiman
6 Aug, 2023, 08:29
Nuaiman
6 Aug, 2023, 08:46

Tha kyou. But how do i update when I do offline suddenly?

safwan
6 Aug, 2023, 08:52

Check out this package on pub: https://pub.dev/packages/flutter_fgbg

safwan
6 Aug, 2023, 08:52

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.

Nuaiman
6 Aug, 2023, 09:11

Thankyou Mr.Safwan

D5
6 Aug, 2023, 17:01

@Nuaiman Does that solves your issue?

Nuaiman
8 Aug, 2023, 13:34

@D5 couldnt try yet, my pc died on me. Waiting for it to get fixed

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more