In my app, i need to send a ntification to the user when the tag notStatus shown below in my firebase changes from 0 to 1.
when this change occurs, the app should check if the value of the tag BattCharge is <=60 and if so sends a notification to the user to perform certain action.
It is not the notification part I am worried about, it is the fetching of one tag, checking if it is =1, and then fetching and checking the value of another tag.
I was able to do so when I was checking for only one tag using the following blocks:
Under the current If/then block, add another "call FirebaseDB1.GetValue" for the tag of your choice. Next, extend the 'if/then' block to become an 'if/then/elseIf/then' block. Under 'elseIf', check the tag as you have done under the 'if' portion for the second tag you want to retrieve. Put the method you want to run under the second 'then' section.
When the data changes, you call procedure2. It gets the data for the tag, and returns:
tag = data/BattCharge
value = 1 (for sake of illustration)
GotValue is raised, and the result is true, it will then proceed to call procedure2 again, and the cycle will continue until value = 0.
The second 'if' statement is contained in the first. This means that the tag BattCharge will only be handled if the tag is notStatus (and obviously BattCharge is not notStatus).
This can be done without the procedure blocks. Try the following if you want to get notStatus only if BattCharge = 1: