[Solved] Cloud variable return null when installed but normal in live test

Hi, I am working on a simple check for update function of my app, and I found a very weird yet consistent bug with the cloud variable and firebase.


As the code show, my app will get the latest build number which is an integer from my own Firebase server, and prompt the user to update if needed. This function works perfectly in live test on both ios and android, however when I install it as apk or on ios devices, the value that firebase return becomes null, and thus the message will end up not able to display the lastest build number. Instead, it just displays as if the variable did not exist. The Firebase was definitely configured correctly as my app uses a lot of cloud variables, and ONLY this particular one don’t work. Ive tried using initialise cloud variable, and use the longer way of firebase.getvalue, however both has the same bug. I also tried renaming the variable. Rebuilding the app also does not help. Is this a known bug or something that could have caused it?

Hey @aliencaocao - this is expected behaviour (although not necessarily wanted behaviour in your case)

Here’s an example from the Tutorials and DIY Guides section on how to handle null values when an app is first loaded:

Having the variable return null the first time only is really useful for doing things like user onboarding the first time they open your app (i.e. anything your don’t want to ask them over and over again)

No the variable isnt a null value. I set it over at Firebase and not through any blocks inside Thunkable. Anyways now it is magically working again without me doing anything.

1 Like

How??

Hi @xcvcxbcbv , this topic is an year old, do it isn’t a good practice to bump it. Thanks.

1 Like

Also, if you post a question, you need to provide details about what you need, what you’ve tried and what happened. It’s best to also include screenshots of your blocks.

2 Likes