Good afternoon
I’m using the translator, because I’m Brazilian
I have an application and I need to direct it to specific forms according to its occupation example:
Email and password authentication using Firebase Authentication
User bank using Firebase Realtime Database
Fields:
Photos
school
occupation
email
password
I was able to store the correct data
I log in right
Only now I want to do the following and I’m not getting it
If the occupation is equal to the student opens the student screen
If the occupation is equal to the teacher opens the teacher screen
I am not able to search for this field in the table, and compare if the user is a student or teacher.
I would like a little help,
Suppose if you use spinner component for getting occupation with only two values such as Student and teacher and upon successful login , use the below blocks to redirect them… simple
I did it like this, in the registration, he chooses if he is a student or teacher,
In the login screen he only has the email and password, he has no option to choose whether he is a student or a teacher.
I wanted to see how to get this information from the bank, since in authentication it is only through the email and password field.
Look at the image below …
Registration screen he chooses the occupation …
Login screen does not have
On the authentication screen, I wanted to see a way to capture the user’s occupation, perhaps by linking to the user’s id and looking for the occupation field and placing it in a global variable and then comparing whether he is a student or a teacher.
Yes, I modeled the code a bit, I will explain and display its screen.
initialize with a global variable;
I use the GET VALUE of the firebese, to search the OCCUPATION field of the user ID, only there I am typing, I wanted it to be automatic when it authenticates itself.
I authenticate by email and password, only that user’s id has to appear in the place where it was entered statically, it would have to be automatic.
There I take the variable and make the comparison, then if you are a teacher, open the teacher screen, if not the student screen.
the user id of option 4 wanted it to appear in item 2, so I think it would be automatic.
O aluno visualiza esse testo, reproduz em áudio e salva e gera pontuação;
Depois o professor vai visualizar a pontuação desse aluno;
Também vou fazer uma rotina pra testar se esse professor existe ou não na base de dados, mas nesse momento é só para mostrar um projeto básico para um projeto maior mais adiante, pois ainda não existe uma base de dados para alunos e professores.
Serão no máximo umas 10 telas, talvez até menos, sendo que o login e o registro eu uso a mesma tela;
Os usuários primeiro precisam se registrar, esse dados armazenado no Database do Firebase;
Após o registro os usuários se autenticam, uso o a autenticação do google., omo mostrei na imagem anterior;
não coloquei nenhuma regra no firebese ainda, pois ainda estou me adaptando a essa estrutura de armazenamento de dados
Seira mais o menos isso vai ter no app, vou duplicar esse post em português, pois a tradução dele deve de ser tenso.
One would be the teacher and the other the student;
There are two different screens;
Teacher posts some texts;
The student visualizes this text, reproduces it in audio and saves and generates scores;
Then the teacher will see that student’s score;
I will also make a routine to test whether or not this teacher exists in the database, but at that moment it is only to show a basic project for a larger project later on, as there is still no database for students and teachers.
There will be a maximum of 10 screens, maybe even less, being that the login and the registration I use the same screen;
Users first need to register, this data is stored in the Firebase Database;
After registration, users authenticate, use google authentication., As shown in the previous image;
I haven’t put any rules on firebese yet, as I’m still adapting to this data storage structure
Seira more or less this will have in the app, I will duplicate this post in Portuguese, because the translation of it must be tense.
Sim, eu uso arranjos verticais, foi assim que eu fiz no login e cadastro, também será assim para as demias telas.
Penso sim em fazer 2 app, mas como não tenho uma base de dados ai nda para realizar as validações em ambos os casos, logo então pensamos em colcoar ambos em uma mesmo app, só que redirecionando para telas especificas.
Nesse momento só queria saber como jogar o USER ID do login Sucess em uma váriavel e usar ela para buscar o campo ocupação dentro do GET VALUE.,
I have tried with this block,working fine and tested
While app initialize , it will check whether user is authenticated or not. If he is authenticated also will check his occupation and will proceed to the concern screen. If he is not authenticated below steps will allowed
step 1: User need to register
( if success Sign up VA will open, Reg VA will invisible, details will store in firebase DB and the occupation will store in tinyDB)
Step2: User need to sign up with email and pwd.
step3: User need to sign in
step4: Next screen will open as per the input data given in occupation
No need to use get value from firebase. However user need to register their details while first time entering into the app. So store the details in to the tinyDB. Now firebase will give you the details like who and all registered
I found it interesting,
I will record it locally, then analyze if it is already or registered
Otherwise, it requests authentication.
I’ll see if I can do this, I’m new to this type of development, but calmly I get there, if you can give a print of the design of the screen, it will make it easier for me.
I agree with you on the English question.
I’ll try to see if I can get it here.