Skip to content

Step 1. Set up the integration

Google Play Games login for mobile apps is a method of logging in with the user's Play Games profile, and it applies only to apps that run on Android and are distributed through Google Play. To implement login, you must complete the external console and Hive Console settings.

After you finish preparing, implement Step 2. Log in.

Note

Google Play Games login and Sign in with Google are different login methods. To offer both, you must set up the integration for each one separately.

1. Prepare the app server redirect URI

External authorization code exchange for Google Play Games requires an HTTPS redirect URI that the app server uses. Decide on this URI first, and in the next step, register the same value in the Web application type OAuth client in Google Cloud Console. You also use this value as RedirectUri in Step 2. Log in.

2. Prepare the Google external console

Prepare an OAuth client in Google Cloud Console, and configure Play Games Services in Google Play Console. For the detailed procedure, see Check the Google Play Games login credentials.

3. Prepare the Games services project ID

In Check the Google Play Games login credentials, also check the Games services project ID to use for the Android settings. You do not enter this value in the Hive Console; you use it in the app's Android resources.

4. Register credentials in the Hive Console

Enable Google Play Games login and register the credentials you prepared in the Hive Console. For the detailed procedure and the conditions that apply, see Google Play Games login credentials.

5. Install the Add-on and configure Android

Install the com.com2usplatform.hiveaxyl.auth.addon.gpg Add-on. For how to install and initialize it, see Install and initialize the module.

After you install the Add-on, you must declare the Games services project ID in the Android manifest so that Play Games recognizes the app. Add the following entries to the Android manifest template of your Unity project.

<application>
  <meta-data android:name="com.google.android.gms.games.APP_ID"
             android:value="@string/game_services_project_id" />
</application>
<string name="game_services_project_id">0000000000</string>

For game_services_project_id, enter the value you checked in Prepare the Games services project ID.

You do not need to write initialization code for the Play Games SDK itself, because the Play Games SDK initializes itself when the app starts.

Next steps