[Solved] How to read a Document in FireBase

Hi i am trying to check if the version the game is you download is the most recent version by searching for the document on firebase and read if the version in there matches up with the ingame version but i cant get it to work pls help :slight_smile:

Can you show what you have already? Then perhaps we can see what the problem is or where you need to add somethingā€¦

OK here is what i have already



Iā€™m not familiar with Firebase, but it looks like in the ā€˜Beginning of sceneā€™ event youā€™re reading the document into the ā€˜VersionGetā€™ variable. However youā€™re then trying to set the text to the value of the ā€˜VersionGotā€™ variableā€¦ Is that a typo?

Yeah was a typo have fixed it but it still dosnā€™t work

Have you run the game in debug mode and checked the value of VersionGot (or VersionGet, whichever youā€™ve decided to name your variable), to see what value is being put into it?

You are loading the whole document, the whole right tab on the Firebase console. As you can see, itā€™s a structure containing for the key Version and as a value the version number. Either use the action ā€œget a fieldā€ to get the Version field of that document, or get the result by reading VersionGet.Version instead.

So i tried the action ā€œload a fieldā€ and it still dosnā€™t work but now i tried it with ā€œcheck for existance of a fieldā€ and there is an error coming out ā€œMissing or insufficient Permissionsā€ i dont know what that means

That means your firebase security rules are forbidding access to that document

and how do i change that?

hey again i got it to work i needed to change something in the rules tab of the firebase