# Achievements

**Support**

Use this to determine if you can implement achievements for your game on the current platform.

```csharp
Bridge.achievements.isSupported
```

Check if getting list of achievements is supported.

```
Bridge.achievements.isGetListSupported
```

Check if built-in popup is supported.

```
Bridge.payments.isNativePopupSupported
```

#### Unlock achievement <a href="#purchase" id="purchase"></a>

Unlocks achievement for a player.

```csharp
private void Start()
{
    var options = new Dictionary<string, object>();

    switch (Bridge.platform.id)
    {
        case "y8":
            options.Add("achievement", "ACHIEVEMENT_NAME");
            options.Add("achievementkey", "ACHIEVEMENT_KEY");
            break;
        case "lagged":
            options.Add("achievement", "ACHIEVEMENT_ID");
            break;
    }

    Bridge.achievements.Unlock(options, OnAchievementsUnlockCompleted);
}

private void OnAchievementsUnlockCompleted(bool success, Dictionary<string, string> result)
{
    Debug.Log(success);
}
```

**Get List**

Returns the achievement list in JSON

```csharp
private void Start()
{
    Bridge.achievements.GetList(OnGetListCompleted);
}

private void OnGetListCompleted(bool success, List<Dictionary<string, string>> list)
{
    Debug.Log($"OnGetListCompleted, success: {success}, items:");
                
    if (success)
    {
        switch (Bridge.platform.id)
        {
             case "y8":
                 foreach (var item in list)
                 {
                     Debug.Log("achievementid:" + item["achievementid"]);
                     Debug.Log("achievement:" + item["achievement"]);
                     Debug.Log("achievementkey:" + item["achievementkey"]);
                     Debug.Log("description:" + item["description"]);
                     Debug.Log("icon:" + item["icon"]);
                     Debug.Log("difficulty:" + item["difficulty"]);
                     Debug.Log("secret:" + item["secret"]);
                     Debug.Log("awarded:" + item["awarded"]);
                     Debug.Log("game:" + item["game"]);
                     Debug.Log("link:" + item["link"]);
                     Debug.Log("playerid:" + item["playerid"]);
                     Debug.Log("playername:" + item["playername"]);
                     Debug.Log("lastupdated:" + item["lastupdated"]);
                     Debug.Log("date:" + item["date"]);
                     Debug.Log("rdate:" + item["rdate"]);
                 }
                 break;
        }
    }
}
```

**Show Native Popup**

Some platforms support built-in achievement list which is shown in overlay

```csharp
private void Start()
{
    Bridge.achievements.ShowNativePopup(options, (success) =>
    {
        Debug.Log($"OnShowNativePopupCompleted, success: {success}");
    });
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.playgama.com/playgama/sdk/engines/unity/achievements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
