i follow step on https://developers.google.com/identity/sign-in/android/backend-auth
GoogleSignIn.silentSignIn()
.addOnCompleteListener(this, new OnCompleteListener<GoogleSignInAccount>() {
@Override
public void onComplete(@NonNull Task<GoogleSignInAccount> task) {
handleSignInResult(task);
}
});
but i get error: cannot find symbol method silentSignIn() Any help appreciated.
I believe it was written on the docs this way by mistake.
1- The method silentSignIn is not static.
2- The silentSignIn is a method of the GoogleSignInClient class.
So the right way to invoke it, is:
GoogleSignInClient googleSignInClient = GoogleSignIn.getClient (activity, gso);
googleSignInClient.silentSignIn ()
.addOnCompleteListener (activity, new OnCompleteListener<GoogleSignInAccount> () {
@Override
public void onComplete (@NonNull Task<GoogleSignInAccount> task) {
handleSignInResult (task);
}
});
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