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.
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);
}
});
That's a mistake in the example, the method is declared in Auth.GoogleSignInApi
. See the references.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With