How to keep the App always logged in with Firebase

0

How do I get my app logged in after waxing?

Ex: I logged in once and every time I start the application again it is already logged in.

    
asked by anonymous 12.11.2018 / 20:28

1 answer

0

According to the Manage Users on Firebase documentation, the recommended way to identify the user connected is to call the getCurrentUser() method. If no user is logged in, getCurrentUser() returns a null value.

Example:

FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null) {
    // Usuário está logado
} else {
    // usuário não está logado
}
    
12.11.2018 / 20:58