GoogleSignInOptions

public class GoogleSignInOptions implements Parcelable, Api.ApiOptions.Optional


GoogleSignInOptions contains options used to configure the GOOGLE_SIGN_IN_API.

Summary

Nested types

public final class GoogleSignInOptions.Builder

Builder for GoogleSignInOptions.

Constants

static final Parcelable.Creator<GoogleSignInOptions>
static final GoogleSignInOptions

Default and recommended configuration for Games Sign In.

static final GoogleSignInOptions

Default configuration for Google Sign In.

Public methods

boolean
Scope[]

Gets an array of all the requested scopes.

int
void
writeToParcel(Parcel out, int flags)

Inherited Constants

From com.google.android.gms.common.api.Api.ApiOptions
static final Api.ApiOptions.NoOptions

Static instance of NoOptions.

From android.os.Parcelable
static final int
static final int

Inherited methods

From android.os.Parcelable
abstract int

Constants

CREATOR

public static final Parcelable.Creator<GoogleSignInOptionsCREATOR

DEFAULT_GAMES_SIGN_IN

public static final GoogleSignInOptions DEFAULT_GAMES_SIGN_IN

Default and recommended configuration for Games Sign In.

  • If your app has a server, you can build a configuration via new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN) and further configure requestServerAuthCode.
  • If you want to customize Games sign-in options, you can build a configuration via new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN) and further configure com.google.android.gms.games.Games.GamesOptions via addExtension.

To maximize chance of auto-sign-in, do NOT use requestScopes to request additional scopes and do NOT use requestIdToken to request user's real Google identity assertion.

DEFAULT_SIGN_IN

public static final GoogleSignInOptions DEFAULT_SIGN_IN

Default configuration for Google Sign In. You can get a stable user ID and basic profile info back via getId after you trigger sign in from either silentSignIn or getSignInIntent. If you require more information for the sign in result, please build a configuration via new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)}.

Public methods

equals

public boolean equals(@Nullable Object obj)

getScopeArray

public Scope[] getScopeArray()

Gets an array of all the requested scopes. If you use DEFAULT_SIGN_IN, this array will also include those scopes set by default in DEFAULT_SIGN_IN.

A usage of this method could be set the scopes for the contextual SignInButton. E.g., signInButton.setScopes(googleSignInOptions.getScopeArray())

hashCode

public int hashCode()

writeToParcel

public void writeToParcel(Parcel out, int flags)