Platform authentication

To integrate your game with Google Play Games Services, first implement platform authentication. This is required to access all other features, such as achievements, leaderboards, and events.

To meet the Google Play Games Level Up user experience guidelines, your game needs to be compliant with the recommended authentication flow.

Initialization and authentication

This is a required step to initialize and authenticate your game:

  • Implement platform authentication by initializing the Play Games Services v2 SDK on startup. For more information, see platform authentication for Android games. This is a required step for accessing Play Games Services features like achievements and leaderboards.
  • Authentication runs as a silent background process during game launch.
  • Existing Play Games Services users will see a welcome message upon successful authentication.

    Automatic sign-in prompt

Profile creation options

Play Games Services profile is necessary for players to engage with the platform. Some players may not have a Play Games Services profile when they start your game. These players will be asked to create one.

You can decide the right experience for your users by picking one of the following options:

  • Auto-triggered profile creation prompts Profile creation prompts appear automatically by default when you launch a game without a Play Games Services profile.

    Profile creation prompt when you launch a game.
    Profile creation prompt when you launch a game (click to enlarge).

  • Disable profile creation prompts at launch and add manual prompts after game initialization You can disable auto-triggered profile creation prompts through the manifest file. This allows users without a Play Games Services profile to proceed with your implemented authentication methods without immediately being prompted to create a Play Games Services profile.

    While users can sign in with any identity provider, we recommend initiating a profile creation prompt Get the authentication result to encourage Play Games Platform sign-up. Trigger this prompt at your discretion, but verify it occurs before users make significant progress in features such as achievements and leaderboards.

    Consider triggering the profile prompt during these recommended moments:

    • After completing a tutorial.
    • During a rewarded moment (for example, winning a match, collecting a rare item, or hitting a milestone).
    • At the time of launching a second session.

Recommended authentication flow

To meet the Google Play Games Level Up user experience guidelines, verify that you are compliant with the player continuity requirements. In order to successfully sign players into your game, use the following authentication flow:

  1. During the startup sequence of your game, review the profile creation options and pick an option.
  2. If automatic sign-in does not work or the user declines, then show a manual sign-in button in case the user would like to login later on.

Player ID

A player ID is an identifier for a Play Games Services player account. Your game can retrieve a player ID for any player that signs into your game using Play Games Services authentication. Your game client integration, game server integration, and cloud-save service can use the ID to securely access player data from Play Games Services.

A player ID is consistent for a user when they play your game on multiple devices. However, it is not always consistent between games. For more information, see next generation Player IDs.

OAuth Scopes

Play Games Services relies on the OAuth system to allow players to give your game access to their account. Play Games Services has a unique scope for games (games-lite) and relies on another scope (drive.appdata) if your game uses the saved games feature. The saved games feature gives access to the user's Google Drive account, which is where the game data is stored.

When using the Play Games Services v2 SDK, you can request extra OAuth scopes. If you need extra OAuth scopes, we recommend calling requestServerSideAccess. For more information, see get the server auth code or retrieve server authentication codes.

Multiple authentication services

Play Games Services provides a gaming identity for Android players, but it doesn't need to be the only identity connected to your users. You can authenticate players using Play Games Services, a social network ID, and your own in-game ID system all at the same time.

Recall API

The Recall API lets games manage links between PGS users and their in-game accounts by storing recall tokens with Google servers. To learn more about enabling this feature, see Integrate the PGS Recall API within your game.

Game client integration

When integrating authentication into your game project, we recommend the following user flow:

  1. During the startup sequence of your game, Profile creation options launches and attempts to login the user or create a new account.

  2. If automatic authentication does not work or the user declines, then show a manual sign-in button in case the user would like to login later.

For information about integrating authentication in your game project, see the get started guide for your project type:

Game server integration

You can obtain a server authorization code by calling requestServerSideAccess once you have verified that the player is authenticated. Pass this server authorization code to your backend game server to communicate directly with Play Games Services servers. This communication allows your server to access player data, including:

  • Player ID
  • Profile
  • Friends list
  • Game progress
  • Achievements

Your server then uses this authorization code with the REST API to interact securely with Play Games Services servers. For more information, see Server-side access to Play Games Services.

Login request quota

There is a daily quota for login requests with Play Games Services. For more information, see Managing your daily quota.