I have a method called UpdateUI and I'm trying to pass a GoogleSignInAccount object while imposing a FirebaseUser object on updateUI. I saw some tutorials where it seemed that the two objects were compatible but to me it returns an error. This is the code

GoogleSignInAccount acct;


public void updateUI(FirebaseUser user){
        if (user != null) {

            mDetailTextView.setText(getString(R.string.firebase_status_fmt, user.getUid()));
            button.setVisibility(View.GONE);

        } else {            

            mDetailTextView.setText(null)
            findViewById(R.id.sign_in_button).setVisibility(View.VISIBLE);
        }
    }

updateUI(acct);

1 Answers

2
Frank van Puffelen On Best Solutions

You can sign in to Firebase Authentication with many different providers, including ones that you make yourself.

The flow for most of these providers is that you sign in to the provider, and then pass the token of that provider to Firebase through one of its API calls. That will then create a FirebaseUser for the external provider's user account.

So a Google sign-in account and a FirebaseUser are not the same, but you can create the latter through the former.