How to check that user is signed in to Play Games from java

29 views Asked by At

I am having such a code, but it returns true even when user is signed out (and so for example achievements are not available)

    public boolean isSignedIn() {
        GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(GoogleExtension.appContext);
        return (
            account != null && !account.isExpired()
            && GoogleSignIn.hasPermissions(account)
        );
    }

What else I should check to validate if user is not signed out?

0

There are 0 answers