Hello, I’m having a weird issue when I try to create a list of data retrieved from Realtime DB. My app has a database of user IDs and each user is also assigned a play ID from OpenSignal so that I can send push notifications. What my code does is go through each user that I want to send a notification to and gets their play ID. However, when I click the button that triggers this function and displays the list, the list isn’t displayed. But when I click the button again, the list is displayed! I really don’t understand why this is happening. Any help would be appreciated.
This is the structure of my database (there are two types of users - customers and businesses):
The firebase GET and SAVE blocks are asynchronous (as evidenced by the THEN DO section). When you put them in a loop or execute one after the other, erratic behavior is the norm. I have found 2 solutions to the problem.