Hello guys, I’m having a hard time with a logic. What I want to archive is very easy (I thought at first) but I don’t know why I’m so dumb not to finger this out.
Firstly, this is how my firebase DATABASE structure looks like:
Now what I want to archive is, when a button clicked, I get all the tags from the bucket “TEST” and sort it and get the value of the first test which is A, and then delete the tag.
It works fine if there is a single person getting the tags and deleting the first tag.
But if two or more people clicks that button tat the same time then they both get the tag A instead of one should get tag A and other one should get tag B.
Please help me with this! I spent many days for this but failed!
The logic should be when screen initialize get all tags from from project bucket Test… When got all tags store them in a list… Then recheck whether the tag has been deleted or not using another tag list block if has not deleted then delete the 1st item of your list and firebase
First of all, add one more tag to the TEST bucket, here it is ‘Clicked’. Now whenever someone delete the tag, the tag will be saved in the clicked tag. See the blocks below.