Google Play Game Services Sign-In - Guide

Install and configure the Google Sign-In SDK [IDEN-Google-02]


This guide assumes the following prerequisites have been completed:

1. Unity: Set up the Beamable SDK for Unity• See Beamable's Getting Started for more info
2. Unity: Switch platform to Android• Unity → File → Build Settings
• Select Android
•. Press Switch Platform
3. Unity: Establish Keystore for Signing• Unity → File → Build Settings
• Press Player Settings
• In Inspector, go to Publishing Settings and create the keystore (or unlock an existing one)
4. Android: Install and configure Google Play Games plugin• See Google's play-games-plugin-for-unity#configure-your-game for more info

Note: You will need both Web application credentials AND platform specific credentials for Android.

Configure Unity Project

Follow these steps to get started:

1. Install and setup GPGS• Follow installation guide from play-games-plugin-for-unity#configure-your-game.
• Make sure that you are able to run the GPGS sample Sign In code before using it as third party provider.
2. Open Configuration Manager

• Unity → Window → Beamable → Open Toolbox
• Click the "Config" Button

3. Edit "Account Management" Configuration

• Set "GooglePlayGames" to true

4. Provide GPS secret to Beamable platform.• See Google's offline-access#create_an_associated_server-side_web_application_for_your_game tutorial for how get client_secret.json and obtain Web client values.
• Go to Portal → Operate → Config and press Add Config and add config with namespace auth, key gps_secret and value that is encoded to base64 content of client_secret.json.

Additional iOS Setup

Make sure that your game flow takes into account fact that the iOS is not supported platform by Google Play Game Services.

User Interface

Right now it is not available to perform third login party using GPGS without writing any code. In order to perform third party login add AccountManagementFlow prefab to scene, create MonoBehaviour script with AccountManagementSignals as SerializeField, assign field using component from AccountManagementFlow instance and call LoginThirdParty method from AccountManagementSignals. Example class can look like below:

using Beamable.AccountManagement;
using Beamable.Common.Api.Auth;
using UnityEngine;

public class ExampleClass : MonoBehaviour
	[SerializeField] private AccountManagementSignals _signals;

	public void LoginToGPGS()
		_signals.LoginThirdParty(new ThirdPartyLoginArgument{ThirdParty = AuthThirdParty.GoogleGamesServices});

Next Steps

From here, the player can edit account details including account name and account avatar.

The player can switch accounts and sign in with various methods. See the Accounts feature page for more info.

When finished, the player can close the Account Management Flow window and return to the game-specific content.