Firebase not working

Hello, I am making a staff app for my parents business and for an Australian law, there cannot be 100 people in the shop at one time. I made an app where you can add and subtract how many people are in the shop at one time and it updates on every device on the app.

It works, although say that Phone 1 was on 58 before they pressed the button next, and it said 63 (which would be phone 2), if Phone 1 pressed the plus button once, it would go back down to 59 instead of 64. Hopefully someone will be able to help.

My code:

before doing an update in the database first get the current value
note: but also this will not work to 100%, because several phones might want to update at the same time…
Taifun

1 Like

friend use common sense, you are assigning a value to the label instead of assigning it to the variable to calculate

1 Like

I’m so sorry but how would I do this?

1 Like

Thank you so much for this, it’s fully functional now!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.