tatiang
November 30, 2022, 11:15pm
11
You need other methods. You don’t use the Data Source blocks at all. You just set/get Firebase values using cloud variable blocks. You can see some examples of that here:
Can you explain by giving an example?
There are two different types of each of the variable classes. Cloud variables can be static (design time) or dynamic (run time)
Static variables can be declared as follows:
[image]
Dynamic variables can be used as part of the code, like this
[image]
or check the value like this
[image]
I’m not sure if this answers your question but I thought it is nice to know
I just discovered a VERY simple and fast way to get and set Firebase data without using the GET or SAVE blocks (which has all sorts of asynchronous issues).
The 2 any button click blocks below return the same data. Just put the GET block KEY variable into the CLOUD variable name and PRESTO. You have a synchronous call to firebase!
[image]
Similarly, you can set data anywhere in the JSON Hierarchy using cloud variables. Both of the examples below update Firebase, but the CLOUD based solution…
I don’t use the RealtimeDB blocks, I just use the variable blocks with Firebase.
1 Like