Edit : DO anyone have a solution for this on STACKOVERFLOW ?
I am using Firebase Database and wanted to show notification as soon as new child is added.
I am usi
When you use addChildEventListener
to attach a listener at a location in the database, onChildAdded
will get called once for each child at that location, even if it isn't new. That's why your notification is always showing.
If you only want to get "new" items, you will need to come up with a way to determine which children are actually new to the user, and filter for those children in your query. Maybe a timestamp or some other flag will work for you.