Sign-in

Google Play Games Services sign-in mechanism serves the purpose of authenticating players and providing them with distinct Android gaming identities (player ID).

This platform-level player ID facilitates the seamless continuation of gameplay across multiple devices, thereby establishing a cohesive connection between the game and the player. In comparison to alternative centralized systems, players are more willing to use this identity for the purpose of sign-in.

Furthermore, the sign-in process offers a reliable identifier for cloud save systems. Players are able to do the following:

  • Resume their progress in the game following a change or reset of their device.
  • Engage in the game across multiple devices, enabling seamless transitions between smartphones and Chromebooks.
  • Uninstall and reinstall the game.

Developers have the option of either using the player ID as a key for their own cloud save solution, or using the built-in Saved Games service.

Play Games Services (PGS) supports automatic sign-in, a zero-friction way to sign in players.

Sign-in with Play Games Services is an effective way to provide players with a strong identity without the need to implement additional features like leaderboards or saved games. This low-friction approach makes it easier for players to engage with your game and create a personalized experience.

Play Games Services v2 SDK

For information on the v1 SDK, see Play Games Services v1 documentation.

The Play Games Services v2 SDK offers several enhancements over v1 in terms of user sign-in:

For users:

  • Improved user experience: After selecting a default account, users are automatically signed in without encountering additional prompts.

For developers:

  • Simplified code implementation: Client-side code no longer requires handling of the sign-in or sign-out flow. Login is automatically triggered at game launch, and account management is streamlined within OS settings.

Login request quota

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

Recommended sign-in flow

In order to successfully sign players into your game, use the following sign-in flow:

  1. During the startup sequence of your game, Automatic sign-in will trigger, attempting to login the user or create a new account.
  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.

Automatic sign-in

When a player launches a game with automatic sign-in enabled, they are signed into the game without interacting with the sign-in prompt. Players can enable automatic sign-in in the Google Play Games app, or in the initial sign-in prompt displayed in your game.

Automatic sign-in prompt

Multiple sign-in 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 sign in players using Play Games Services, a social network ID, and your own in-game ID system all at the same time.

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 sign-in. Your game client, backend game servers, 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 cannot request extra OAuth scopes. If you need extra OAuth scopes, we recommend using the Google Sign-In SDK with Play Games Services.

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 sign-in into your game project, we recommend the following user flow:

  1. During the startup sequence of your game, automatic sign-in launches and attempts to login the user or create a new account.

  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.

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

Game server integration

After a player signs into your game using the Sign-in services, your backend game server can communicate directly with Play Games Services servers to access a player's ID, profile, friends list, and other Play Games Services data. This requires a server authorization code that is provided by the Play Games Services SDK. Your server can use the authorization code along with the Play Games Services REST API to securely communicate with Play Games Services servers.

For more information, see Server-side access to Play Games Services.