When SCREEN initialize

Hi, I have a problem, When initialize a screen, y want run a function call reset "Reiniciar"
danger

Inside that function I have more funtions, and that functions no work correctly, when finish the game you press reset with a choose dialog, it call RESET function and every works perfect the second game.

The problem is, the people must have the game correct in the first game.

Why when I call reset when SCREEN initialize no works?

1 Like

Give me the code picture or aia file

It is possible that you need to chain your procedures, that is, to call the second one from the first one, the third one from the second one and so on, otherwise they may all be trying to run at the same time, requiring variables from each that are not immediately available.

2 Likes

I think we have same concern now about screen initialization, however, what Im trying to build or solve is different from yours.

I am try to automatic obtain data from my realtime firebase db and the screen initialization doesnt prepare it.


Image here is the starting process that should run necessarily to open/visible to true the screen and yet it does not do its job.

So I was wondering if fetching data from realtime db firebase required onclick function since automating it to run to get the value does not work.


Image here is the conditional statements that should run after the screen initializes in order to open specific screens.

Do you have any tips on this algorithm or block arrangement or alternative ways?

Do not use firebase like this to get data..(i believe your method won't trigger) so try like this

Set firebase to get value tag (shop owner/get global variable) if not found (create empty dictionary)

Once firebase got value use dictionary block to parse into required field. Simple work

Do you mean by doing this method below.


This image is what I've used in web component getting users and auth them in my db.

I have stored value like this in realtime db

Yes, set call tag as shp_ownr/that I'd

Once firebase got value, use get value for the key block to get required value .

I mean get value for the key ownr_email from the the get value dictionary

1 Like

I still could not get it, Do you have any block samples that I can study on or test on? Much appreciated

@Rax, your blocks images are unreadable.

Right click on white space in the blocks editor, and download blocks as image.



messed up my blocks a while ago trying to explore methods.

Some example blocks...(I used the web component)

image

image

1 Like

Same here, I am trying to work with web component instead than doing the current method that I am currently using.
Its good that theres there is metric AI 2
https://firebase.google.com/docs/reference/rest/database#section-get

Its a very faulty method since there is two "" that I havent noticed yet till I explored further. I was looking for a better methods and thanks for providing some.

Is it better to use realtime database or use firestore instead? what will be the easiest?

You will find realtime database easier to work with, although firestore offers a different set of features, depending on your needs.

1 Like

Im having a hard time understanding the link provided from metric since som block is collapsed.

image

What is the full details of this Obfuscated Text?

I am referring from this documentation where I am trying to set this up.

Why are you trying to work with the Firebase Arrays guide ?

1 Like

No no, im trying to use web component Rest API to fetch and push data to my realtime database. I just want to know how did you set up global fbURL?

Ohh I think I got it, Thank you :sweat_smile:

I mean like this only . (Busy with work) i have put the users ID in listview. You can call it from tinydb or anyother source. But result will be same..




(Note: you should not use any firebase project)

1 Like

:question: