Multiple Listeners

I was just working throught a similar issue. A few observations and strategies for you (and those who find this thread in the future):

  1. Having multiple listeners for the Realtime DB Component on different screens results in only one of the Change Events Triggering
  2. Creating Mulitple Realtime DB Components (one for each screen) pointing to the same firebase database allows mulitple screens to update whenever data changes

Mulitple asynchronous event can be confusing. So to illustrate the point, here is a sample application:
https://x.thunkable.com/copy/5e64e2455b568f7b8bdfbd0a165d4e40

If you add your firebase Web API key and database to this sample application, you can test it to see how it work. Here are a few highlights:

I have two separate screens (cheese and crakers). Each needs to update if either the cheese or cracker branch changes (respectively). I created 2 Realtime DB components, one for cheese and one for crackers. I created 2 listeners per realtime DB. With this system I can have any number of listeners, as long as each Realtime DB has only one listener (on one screen).

The Cheese Screen and Listener


The Cracker Screen and Listener

2 Likes