Authentication with Google Play Games
For those who looking to leverage the amazing features of Google Play Games in their Unreal Engine Projects, EIK has you covered.
1. Setup Keystore for Android
For setting up the Google Cloud project, we'll need a keystore in place, so let us set that up first.
Make sure you have JDK installed and in your PATH, check this by opening your Terminal/CMD and running
echo %JAVA_HOME% - On Windows
echo $JAVA_HOME - On MacOS
If a valid path is printed pointing to your JDK's location, then JDK is installed and most probably in your PATH as well.
-
Run this command
keytool -genkey -v -keystore key_name.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Then fill in the prompted values and confirm, you should see a similar output as below:

-
Copy your keystore file into
Project/Build/Android/key_name.keystore -
Go to
Project Settings->Android(Under Platforms) -
Click configure
-
Scroll down to
Distribution Signingtab. -
Fill in the keystore details

-
Go to
Project Settings->Packaging(Under Project). -
Under Project, Set
Build ConfigurationtoShippingand TickFor Distribution

-
Then, once again, open your Terminal/CMD, cd into
Project/Build/Androidand run the following command:
keytool -keystore key_name.keystore -list -v
Enter the keystore password when prompted -
You should see a similar output, you need to copy the
SHA1value and store it somewhere safe as we will need it while creating anOAuth Clientin Step 2.

2. Setup Google Cloud project
-
First, we need to setup a Google Cloud project, so go to your Google Cloud Console and Create a new project (opens in a new tab).
-
Enter an appropriate project name and click Create.
-
Then after the project has been created, click
SELECT PROJECT

-
On the left panel, select
OAuth consent screen, then clickGet started

-
Fill in all the necessary details about your game, then click
Create

-
Click
Create OAuth client

-
Fill in the Package name found in
Project Settings->Android(Under Platforms) ->Android Package Name -
Fill in the
SHA-1 certificate fingerprintas saved in Step 1.

-
Click
Createat the bottom of the page.
You don't need to store the Client ID
-
Go to
Data Access, and clickAdd or remove scopes

-
In the
Filterbar, search forGoogle Play Games Services APIand select it. Then, select the THREE scopes shown below:

-
Click
Update, then clickSave
3. Setup Play Console Project
First, we need to setup a Google Play Console project for our game. So open up your console and follow these steps:
-
Click
Create appon the Home page

-
Make sure you set
App or gametoGame

-
Click
Create app -
After the app is created, on the left tab, go to
Grow Users->Play Games Services->Setup and management->Configuration
-
Select Create new Play Games Services project. Then choose the Cloud project that we created in Step 2. Then click
Useon bottom of the screen
Make sure you don't click Create new cloud project as we've already done that in Step 2

-
Then you should see the steps to
Set up Play Games Servicesas follows:

-
Click the second option
Create OAuth consent screen in Google Cloud Platformthen instantly clickConfirm configurationas we've done that in Step 2. -
Scroll down to
Credentialsand clickAdd credential. -
Make sure the
Typeis set toAndroid, then scroll down toAuthorizationand select theOAuth Clientthat we created in Step 2.

-
Click
Save changes -
Go back to the
Configurationpage. -
Ignore the rest of the steps to
Set up Play Games Services -
Click on
Edit properties

-
If you want to use the
Saved Gamesfeature, turn it on, otherwise ignore this step.

-
Go back to the configuration page.
-
Copy the
Project IDas shown below:

-
Go to
Project Settings->EOS Integration Kit(Under Game), and paste it in theGoogle Play Games App ID

You're all set!
Congratulations, you're now all set to use the amazing features provided by Google Play Games Services with the help of EOS Integration Kit!
Now, just build your project for Android and watch it automatically login with Google Play Games Services!
Here are the available nodes for Google Play Games Services with EIK:

