Play Games Services sign-in provides you with a player's gaming identity, whichis a platform-level, gaming-specific identity for Android players. This identityhelps build a relationship between your game and the player. Players are morewilling to use this identity to sign in than with alternate centralized systems.
In addition, sign-in gives you a strong, consistent identifier that you can use as a key to acloud save system. Cloud save is highly-valued; it enables players to do thefollowing:
- Pick up where they left off if they change or reset their device
- Play the game on multiple devices (for example, on another phone or aChromebook)
- Uninstall and later re-install the game
You can use Play Games Services identity as a key for your own cloud savesolution, or you can use the freeSaved Games service.
Play Games Services (PGS) supports automatic sign-in, a zero-friction way tosign in players.
Recommended sign-in flow
In order to successfully sign players into your game, use the followingsign-in flow:
- During the startup sequence of your game, Automatic sign-inwill trigger, attempting to login the user or create a new account.
- If automatic sign-in does not work or the user declines, then show a manualsign-in button in case the user would like to login later on.
Automatic sign-in
Automatic sign-in allows users to sign into your game with zero friction - it'sautomatic! If your game requests that the user sign in and the automatic sign-insetting is enabled (in the Google Play Games app), then you will receive the user's PGSidentity credentials and the user will see the PGS sign-in experience.
Automatic sign-in is a setting users can control. Users can choose toautomatically sign into all games or be asked each time.
OAuth Scopes and PGS
PGS relies on the OAuth system to allow users togive your game access to their account. PGS has a unique scope for games (games-lite
) and relies on another scope(drive.app_data
) if your game uses the saved games feature. The saved gamesfeature gives access to the user's Google Drive account, which is where the gamedata is stored.
Please note that with PGS v2, you can no longer request extra OAuth Scopes.If this is needed, we recommend using the Google Sign In SDKalongside PGS.
Support for multiple sign-in methods
PGS provides a gaming identity for Android players, but it doesn't need to bethe only identity connected to your users. You can sign in players using PGS, asocial network ID, and your own in-game ID system all at the same time. Eachsystem provides unique value for both you and your players, and all can worktogether to make a great experience for Android players.
Securely retrieve and verify the player identity for backend integration
You can request a Server Auth code to enable your serverto talk directly to the Play Games Services servers via the REST API with theauthority of the signed-in player. This enables direct access to the player'sID, profile, and other information (such as friends list, if authorized). If youstore any Player IDs, friend IDs, or other related data in your backend, thismethod must be used to remove the potential fordevice-side manipulation of these fields.
Additionally, for some older games and players, the player ID returned by theAndroid SDK for a player may not be the same ID that other players see whenviewing that player in the same game - this is particularly relevant when usingthe friends list. However, the player_id
returned within the REST API isalways consistent and is always the ID that is seen by other players.
For more information, seeOffline access and theREST API documentation.
Client implementation
To learn how to implement sign-in support on Android, seeSign-in in Android Games.