Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find api GoogleSignIn.silentSignIn

I am following the tutorial found here. But I am unable to find the api: GoogleSignIn.silentSignIn() as mentioned in the doc.

Is it deprecated or removed?

If yes, would anyone please correct the guide.

like image 377
Subhankar Mukherjee Avatar asked Nov 28 '17 19:11

Subhankar Mukherjee


2 Answers

A correct way

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(getString(R.string.server_client_id))
            .requestEmail()
            .build();
GoogleSignInClient googleSignInClient = GoogleSignIn.getClient(this, gso);
googleSignInClient.silentSignIn().addOnCompleteListener(this, new OnCompleteListener<GoogleSignInAccount>() {
    @Override
    public void onComplete(@NonNull Task<GoogleSignInAccount> task) {
        handleSignInResult(task);
    }
});
like image 95
AlexS Avatar answered Nov 05 '22 04:11

AlexS


That's a mistake in the example, the method is declared in Auth.GoogleSignInApi. See the references.

like image 23
devrocca Avatar answered Nov 05 '22 06:11

devrocca