Firebase Listener Problem

I am really frustrated when dealing with the real-time listener.

What I am trying to do is that when the user click Send button, it will save the message to the database. Then, the listener should listen to the data change and clone the label and show the message. However, the listener is a little bit weird…

The first iphone screenshot is captured right after click Send. It has listened to the same message over and over while the second screenshot is the expected result. It showed if I click back and go to the page again.

Any ideas? Thanks!



In your blocks, I don’t see the block of enabling the listening function.

Can you explain a little bit more? I am following the tutorial in this below youtube. You may start at 6:58.

Can you show the whole blocks? It may not be due to the listener issue. may be your use of screen in “start” or “open” modes or using label clones (you need to remove label clones to “refresh” your page) . From your limited description, it seemed that when you re-“open” screen it worked. So, it’s either the clones were automatically removed or a fresh listener is initiated.