Hi, does anybody know how to have a dynamic chat notification indicator in flutterflow using its 1:1 chat template?
As there's no direct way to find how many unread chat msgs are there, the best I could find is to count how many chats the active user has, how many chats the active user appears in the last_message_seen_by array, and compare these two numbers. If they don't match it means there are unread messages.
I implemented this logic in the navbar component (custom) using on initialization actions.
It works well when the user opens/refreshes the page or navigates to another page. However I cannot find a way to make it dynamic, meaning that the indication will show (as a Badge condition) when there's a new incoming chat message without the user doing anything.
I tried with nested firebase queries but it did not trigger the badge automatically.
Any help on that is appreciated. Thanks