Problemas com Firebase

I’m having problems with Firebase.

The first problem is that when I try to register the user, nothing simply appears. I type in the email and the password and click on register, but no success or error message comes back. I am using these blocks.

The problem is with the blocks, because when I use the login through Google, I am able to register things in Firebase.

The second mistake is when I try to access something already saved in Firebase, I am not able to. This is the block where I have to access the player’s nickname and write it on the screen.

The third mistake is that I cannot change the data from Firebase, like punctuation or the current question.

Note: I carry the email base from screen to screen.

Insert Bucket manually

Remember Firebase Authenticate works only in Exported APK don’t try it in companion

Edited: Only this aix works in companion with firebase

1 Like

It is still not reading the data inside the “Dados”. When I put “tag” it reads “Usuario”. The problem is that it is not reading the value. Is the problem when registering?

The main issue with your Firebase setup is that you are only using GetValue without ever storing any data, and you are also using a leading slash in your tag. In Firebase, tags should be treated as simple keys, not paths with /. This is why your block with /Usuario does not return anything.

When registering a user, you need to explicitly save their data into Firebase. For example, when a new user registers, you should call StoreValue with a tag and a value. Later, when you want to retrieve it, you use GetValue with the same tag.


When registering a user:

Call FirebaseDB.StoreValue

  • tag = Usuario
  • value = {"email":"user@example.com", "password":"12345"}

When retrieving user data:

Call FirebaseDB.GetValue

  • tag = Usuario

And in GotValue event:

Set Label.Text to value


So in short:

  • Remove the / before Usuario.
  • Use StoreValue during registration.
  • Use GetValue only for reading.

Hi Marcos,

I’ll join with a reply as well :rofl:.

Signup

Regarding signUp, yes, FirebaseAuthentication works only in APK, but if used in the companion it gives a very specific error saying it can’t be used, and I imagine Marcos would have noticed that :grinning_face_with_smiling_eyes:.

I don’t remember if it showed an error or not, but just in case, let me remind you to enable the correct sign-in methods.

Get/Store

I have a question for you

how are you saving the email in emailbase?

Because, as you can see on Firebase, the dot isn’t accepted as a character in a node.
immagine

So when you do store/get, the tag must be

Dados/email@email_com/Usuario

As Ibrahim pointed out, you can specify the bucket with each request.

blocks(58)
Or, if you don’t plan to change it while using the app, you can set it in the Designer settings.
immagine

Waiting for your reply

Happy :kodular:oding!

This is my login screen


If the user does not have a nickname, they are directed to this screen.
If he already has a nickname, he will go straight to the next screen. This function is working.


This is the screen that is having the problem.I have already done everything they advised me and nothing works.

How the login screen is reading whether the user has a nickname or not. I believe the problem is not with Firebase, and it is working fine. The problem is in copying the value that is saved in Firebase.

This screen is the registration screen. This one is not working at all.

Note: I am testing as APK
Note 2: When registering, it doesn’t show any errors. It simply does nothing.
Note 3: I am only able to go to the nickname screen through Google. That’s the only way I can save something in Firebase.

In Firebase, it is like this in the Realtime Database.

The problem is that my application is not reading or changing anything that is between the “”

Hello marcos,

Sorry I thought I had answered you but I had the message left in draft :man_facepalming:

You’re aiming for the wrong bucket,
if you need to read a single data you need to provide the whole path up to the key

Here the projectBucket is Se-Errar-Ore
the tag to reach Usuario will be Dados/email@email_com/Usuario


Did you set the FirebaseAuthPro API key in the designer?

1 Like

I managed to fix everything.I needed to delete the Firebase project and redo it from scratch on Firebase. I returned all the codes to how they were and it worked normally.The only thing that was wrong for registering the user (email and password) was the notifier. I wasn’t using the alert, so it wasn’t showing me any errors.

Thank you all for the help

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.