# Setup Guide

## Open Settings Window

Go to Tools -> Gley -> Game Services

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FirIh2pgr4nX0zKOiABhj%2Fv2-Open.jpg?alt=media&#x26;token=833b13c1-2a24-47d7-a9b3-90bd2c4fdfe8" alt=""><figcaption><p>Open Settings Window</p></figcaption></figure>

**Download SDK**

{% tabs %}
{% tab title="Android" %}

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FngXTCGZIbruQiHvdQ8LT%2Fimage_2023-08-10_111459209.png?alt=media&#x26;token=93705cf8-73df-40e3-be35-a45090f47ddd" alt=""><figcaption><p>Android Setup</p></figcaption></figure>

Select Android platform.

Press **Download Google Play Games SDK** and import the plugin in your unity project
{% endtab %}

{% tab title="iOS" %}

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FJNB4zfHBYpn2O80p9t2o%2Fv2-iosSelect.JPG?alt=media&#x26;token=f028868d-a6c8-44cc-971b-46090bbe6f27" alt=""><figcaption><p>iOS Setup</p></figcaption></figure>

Select iOS platform.

No additional SDK is required.
{% endtab %}
{% endtabs %}

## Add IDs

{% tabs %}
{% tab title="Android" %}

### App ID

Go to your Google Play developer console and select your game.

Go to configuration and copy your Project ID.

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FyOPRTZM6sIDBWdtuKGQk%2Fv2-AppID.JPG?alt=media&#x26;token=e6e4fbce-0229-4174-9067-adcf69a3ec35" alt=""><figcaption><p>Project ID location</p></figcaption></figure>

Paste your Project ID inside Google Play App ID field&#x20;

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FJpyqnSK1uxMFCafWLA1E%2Fv2-Addappid.JPG?alt=media&#x26;token=0cf2ca76-f988-4340-a85c-9f1ff6a2b589" alt=""><figcaption><p>Add App ID</p></figcaption></figure>

### Achievement IDs

Go to your achievements in Google Play Console

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FDspA6uJ4vQaEhhGQUfZm%2Fv2-Achievements.JPG?alt=media&#x26;token=ad740747-a32d-4156-b4db-5ee95e33d57f" alt=""><figcaption><p>Google Play Achievements</p></figcaption></figure>

Add your achievements ID inside Settings Window

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2Fu2wmVsp3IF6RQCPQ4xDE%2Fimage_2023-08-10_114138439.png?alt=media&#x26;token=102fd7d8-ace3-44ee-95b2-2aec7e972dde" alt=""><figcaption><p>Settings Window Achievements</p></figcaption></figure>

|                         |                                                                                                                                                                                                                                                    |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Add new achievement** | Adds a new achievement field                                                                                                                                                                                                                       |
| **Remove**              | Removes the achievement field                                                                                                                                                                                                                      |
| **Achievement Name**    | <p>Achievement Name (can only contain alphanumeric characters - no white spaces or special characters). </p><p>From the achievement names an enum will be automatically generated and it will be later used in code to submit the achievement.</p> |
| **Google Play ID**      | Store ID                                                                                                                                                                                                                                           |

### Leaderboard IDs

Get your leaderboard IDs from Google Play

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FYHPBOZ5aroaaWGSs0kS6%2Fv2-Leaderboards.JPG?alt=media&#x26;token=59bb205e-b47a-41ed-8af0-7a08980fb045" alt=""><figcaption><p>Google Play Leaderboards</p></figcaption></figure>

Add your leaderboard IDs inside Settings Window

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FFoWG9PUMjgSEv05nKOQg%2Fimage_2023-08-10_122828727.png?alt=media&#x26;token=50359c26-61f4-42b4-b4bc-d512057d2fca" alt=""><figcaption><p>Settings Window Leaderboards</p></figcaption></figure>

|                         |                                                                                                                                                                                                                                               |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Add new leaderboard** | Adds a new leaderboard field                                                                                                                                                                                                                  |
| **Remove**              | Removes the leaderboard field                                                                                                                                                                                                                 |
| **Leaderboard Name**    | <p>Leaderboard Name (can only contain alphanumeric characters - no white spaces or special characters). </p><p>From the leaderboard names an enum will be automatically generated and it will be later used in code to submit the scores.</p> |
| **Google Play ID**      | Store ID                                                                                                                                                                                                                                      |
| {% endtab %}            |                                                                                                                                                                                                                                               |

{% tab title="iOS" %}
Copy Leaderboards and Achievements IDs to Settings Window&#x20;

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2Fa5pwAtoyL312CQHkxStZ%2Fv2-iOS%20IDs.JPG?alt=media&#x26;token=8fdc9f33-8fc4-4c4d-b75a-2750c2b5b2ea" alt=""><figcaption><p>Project IDs</p></figcaption></figure>

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FLDxIIWxoM9WnqO5andrE%2Fimage_2023-08-10_125044542.png?alt=media&#x26;token=da878005-cae9-493d-81c9-e1462c0bfe23" alt=""><figcaption><p>Settings Window IDs</p></figcaption></figure>
{% endtab %}
{% endtabs %}

## Save

Every time you make a change inside Settings Window press the **Save** button.

## Preparing the build

{% tabs %}
{% tab title="Android" %}
Before building your app, make sure to Force Resolve the android libraries.

Go to **Assets->External Dependency Manager -> Android Resolver -> Force Resolve**

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FgVlgJASnpbtV9x8qqRwA%2Fv2-ForceResolve.jpg?alt=media&#x26;token=d3684509-859a-454f-be12-c41bc350e0f7" alt=""><figcaption><p>Resolve Android Dependencies</p></figcaption></figure>
{% endtab %}

{% tab title="iOS" %}

{% endtab %}
{% endtabs %}

## **Build**

If you get this error at build:

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2F8J55qsXo85NCG2uYfj1Q%2Fimage_2023-08-29_143008321.png?alt=media&#x26;token=3d2a74f0-cb23-4f8b-859f-dde97ac7fb82" alt=""><figcaption><p>Colliding APP_ID</p></figcaption></figure>

Go to **Assets -> Plugins -> Android** and delete **GooglePlayGamesManifest**

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FC2pbhXIZAmQ2VJ1kTckY%2Fimage_2023-08-29_143158548.png?alt=media&#x26;token=3ab7669f-c5a9-4ba7-88c7-ff045a248bfb" alt=""><figcaption><p>Delete Manifest</p></figcaption></figure>

This warning is normal. Is thrown by Google SDK because you did not use their setup window. Just close it.

<figure><img src="https://2479390621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWan87AUQdgXRIESahU%2Fuploads%2FRnYzwcKIi7MVqm8N2ZUo%2Fimage_2023-08-29_143802624.png?alt=media&#x26;token=8307e80d-7146-4249-835d-7bbd84dcccc4" alt=""><figcaption><p>Build Warning</p></figcaption></figure>

## Test

{% hint style="warning" %}
Achievements and Leaderboards only work if your app is uploaded to the store and downloaded using your test user. They do not work inside Editor or if you build & run your app on device.
{% endhint %}

**To test if your SDK integration and your IDs are correct please build the test the scene provided:**

**Assets/Gley/GameServices/Example/Scenes/GameServicesTest.unity**
