Check Firebase Login

0

Good afternoon!   I have a difficulty in an app that I'm creating with firebase ... Next, I have the login login and in it I have the login button with the google account, what I want to do is the following, when the person selects the account of google, after the authentication I want to make a select there in the firebase and confirm if all the data of cadastre were filled, if yes, the person is directed to the main activity, if it is lacking data like education, profession etc, it means that it still does not have an account in realtime database, so it is directed to make the register using google mail ... my validation is like this, however, below and only a test, as I am querying the identifier q is the ID it should already I can see in the firebase console, however, it always falls as false the first time and is taken to the registration screen, so I understand that the following logic is missing something:

if (firebase.child("USUARIOS").child(identificador).equals( usuario.getId() ) ){
                            openMainActivity();
                        } else {
                            usuario.salvar();
                            openCadastroActivity();
                        }
    
asked by anonymous 03.09.2017 / 18:38

1 answer

0

So I understand these are trying to access data from the auth firebase .

I suggest you create the firebase database a user node, and record / update the data whenever there is an authentication, because auth firebase authentication does not record the data you need and also does not allow you to search for restricted information.

Example:

After authenticating and saving / updating the user, create a data verification logic and open the desired activity.

    
11.09.2017 / 20:42