I'm creating an application that uses Firebase , which in turn uses Google Play Services .
In my tests, when Google Play Services is outdated, it crashes the application and gives an error saying that the application has stopped.
Then a notification appears saying: Update Google Play Services - App only works with an updated version of Google Play Services.
Is it possible to make an error handling to warn the user that the Google Play Services update is required without crashing the application and closing it?
It's the error for me when I run this line:
Button loginbtn = (Button) findViewById(R.id.loginbtn);
loginbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LoginProcess("[email protected] ", "senha123456");
}
});
...
public void LoginProcess(String email, String password){
mAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
FirebaseUser user = mAuth.getCurrentUser();
Toast.makeText(getParent(), "Logado com sucesso.", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getParent(), "Falha de Login.", Toast.LENGTH_SHORT).show();
}
}
});
}