I just want to have a simple app that is saving data on my firebase and then retrieve the data in another text field whenever this cloud variable change.
when I am saving the data it is ok on my cloud but when I trigger the initialize or change variable and set the text 2 nothing appends
second question :
do you know how to get the block when cloud variableā¦ init ā¦ with dynamic cloud variable name.
just to let you know that we found with the support an issue with the sign-in and the listener on the same screen.
If we split the sign_in and the cloud listener into 2 screens it is working.
while they are not the most secure rules, they do require a user to be authenticated to access any data. if youāre not signed in, you canāt access the data.
It should be noted that the āwhen cloud variable changes or initializesā should not live on the same page that you are logging in through. Although that is typical of a single page app, it currently does not work in Thunkable apps and is not best practice when making an app in Thunakble.
So, log in on page 1, listen for changes to your cloud variable on page 2
something that I found is that the setup of the cloud variable in the realtime db and the listener need to be done with the sign in method of thunkable.
but the auth with the sign_in cannot be used for other firebase auth. (I do not see how to get the token)
so if you want to use firestore and realtime db for the project and the ācloudā variable function for the listener you will need to use a double auth with sign_in block in order to use the cloud function and the auth with a web api to get the token for the rest.
ps: we can use realtime with the web api and the token but then I did not manage to have the main function of RTDB that is the listener for the app
The perfect solution is for Thunkable to allow the Sign In component to provide the token along with the user ID that is currently provided.
However, if it is OK with you to share your project, I need to go at it and see if possible to use the Listener feature in it.
[Edit]
I just checked and it seems that cloud variables in Thunkable only sees Realtime DB in Firebase and that leaves you with practically no choice for this issue.
At this time the Firebase auth blocks will not allow you to pass around or see the userās access token. In your case, using Firestore or the Firebase functions will require you to manually create the sign-in flow.
You are also correct that if you do use a manual sign in method, you wont be able to use the āwhen cloud variable initializes or changesā when you have security rules on your firebase database.