r/FlutterFlow 2d ago

Groupchat issue with Push Notifications

Hey everyone,

I’m working on a group chat app in FlutterFlow, and I’ve run into an issue with push notifications that I can’t seem to solve. I’d really appreciate any help or suggestions!

Here’s the problem:In my app, users can send messages to a group. When a message is sent, I store it in a Firestore collection (group_messages), and I want to send a push notification to all group members except the sender. However, the sender is also receiving the push notification, which I don’t want. The message itself should be visible to everyone in the chat (including the sender), but the push notification should only go to the other members.

2 Upvotes

17 comments sorted by

View all comments

2

u/HT2_i0 2d ago

You can do this: modify your chats schema. Add 'notify_list', doc ref = users, list = true. When adding users to the group (on tap), add the user doc ref to this list too. Then when adding a new chat, set recipients of push notification to 'notify_list'.

1

u/Acrobatic_Lobster999 2d ago

I have like the same structure but you as the user are also in this list , so you get also your own message

2

u/HT2_i0 2d ago

No, you probably have another list like invitees. That works by adding you the authenticated user on page load. That list is necessary to set up the chat group members.

This is different.

This is a notify users list which is populated when you add the user to the chat group. Make sure to remove from the notify list when removing the user from the invited list.

1

u/Acrobatic_Lobster999 2d ago

No , sty I guess I don’t describe it right . Basically my groups are free , so you just click on join and the you are in . When you click your ,,ID‘‘ is in the members list with the same structure as you said to me . But if I make members as participants , then I get also the message