The login screen guide I followed doesnt work and I dont really know how to fix it

I followed this guide and i dont really know how it works METRIC RAT AI2 - Registration & Login with Firebase Authentication
Im not sure what i need to add myself. From all i know i need to add api keys but i dont know how to

can you give me to the steps for firebase no2 and 3?
I dont really understand what i need to do exactly

You can get you APIKey from firebase. Project Setting --> Web API Key:

You firebase must have the URL of your own project:

Try to follow the example, it is very well explained. You have even an aia example.

i used the aia example too and it doesnt work. i got my api key but i dont really know where to put the URl of my own project tho

oh but it's not in the aia file though

in the aia file, if i were to just replace the web with firebase db it would be fine?

You do not use the Firebase component, you use the web component.

Put the API key in the variable called APIKey.

You do not need your firebase url, everything is handled by using the APIKey.

You do not say what "doesn't work" for you ?

My guide is not really for beginners, it requires a certain level of understanding of both AI2 and Firebase. The guide does not show the steps needed to setup firebase authentication for email/password, it makes an assumption that you would laready have that set / know how to do it.

oh yeah I realised that the email account I've used to register has already been registered so the error kept occurring. Is there a way for me to keep the user logged in? I've tried using the apk it requires me to re-login everytime

I've finished making a login screen for my app. Now I want the app to be able to differentiate who the user is and display the contents based on whether the user is an admin or not. Can anyone give me an idea on where I should start?
these are the blocks for my login and signup screen if needed

There are a couple of ways you can set admins. The easiest is to do it with secure rules, giving a UID different access to normal users. The second is much the same but more complex to construct, using the "admin" feature in firebase / rules.

is there a guide you can show me ? maybe like if I create a google spreadsheet where I can make two columns where one is for the uid and the other is for the access level like "user" or "admin". Then when the users login, I compare their uid to the access level

Something like this (not tested):

{  "rules":
		{".read": "auth.uid === 'Fg4xzpGK8yWtjhgac5wnk8gw8FGs1'",
         ".write": "auth.uid === 'Fg4xzpGK8yWtjhgac5wnk8gw8FGs1'"
       { "$uid":
       { ".read": true,
         ".write": "auth.uid == $uid"


oh but i just want to able to label which user is what. They don't have to be admins. LIke I want the accounts to be labelled students and some accounts labeled as teachers

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