> For the complete documentation index, see [llms.txt](https://wiki.playgama.com/playgama/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.playgama.com/playgama/bridge-sdk/api/social.md).

# Social

The Social module lets players share the game, invite friends, join your community, add the game to favorites or the home screen, and rate it. Social actions bring free organic traffic and improve retention.

{% hint style="info" %}
Trigger social actions only from direct player input. Automatic calls on game start, level complete, or similar events violate many platform policies and can get the game rejected.
{% endhint %}

## Configuration

Social content and settings live in the [config](/playgama/bridge-sdk/config.md), not in code. The game passes only the id of a config entry to `share`, `inviteFriends` and `createPost`, and calls `joinCommunity` without arguments — so the same code works on every platform, and the texts can be changed without rebuilding the game.

### Content by id

The text, image and link of a share, an invite or a post are declared once in the config and referenced by id from the game. Add an entry to `social.shares`, `social.invites` or `social.posts`, then pass its id — `share('score')`, `inviteFriends('friends')`, `createPost('gift')`. Every platform gets the entry's common fields, and a block named after a platform id replaces them for that platform only:

```json
{
    "social": {
        "shares": [
            {
                "id": "score",                          // the id you pass to share()
                "text": "Can you beat my score?",
                "url": "https://your-game-link",
                "reddit": { "text": "Beat my score!" }  // used on reddit instead
            }
        ],
        "invites": [
            {
                "id": "friends",
                "text": "Play with me!",
                "image": "https://your-game.com/invite.png"
            }
        ],
        "posts": [
            {
                "id": "gift",
                "text": "Free coins inside!"
            }
        ]
    }
}
```

An unknown id rejects the call and sends nothing, so the content a player sees is always the content you declared.

Besides `text`, `image` and `url`, an entry can hold any platform-specific field, and the field is forwarded to the platform SDK as is — for example, `media` of an `ok` post. Put such fields into the platform's block of the entry.

The settings of [Join Community](#join-community) go to `social.joinCommunity`, usually per platform in `platforms.<id>.social.joinCommunity`.

{% hint style="info" %}
Writing the content in the config keeps one text per platform in one place, and it is what lets a post carry [rewards](#post-rewards) — the platform backend reads them from the same entry.
{% endhint %}

## Share

Let players share a score, achievement, or game link. Show the share button only when sharing is supported.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isShareSupported
```

Use this flag to decide whether to show the share button.

```javascript
// the id of a social.shares entry — the content lives in the config
bridge.social.share('score')
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isShareSupported
```

Use this flag to decide whether to show the share button.

```csharp
private void Start()
{
    // the id of a social.shares entry — the content lives in the config
    Bridge.social.Share("score", OnShareCompleted);
}

private void OnShareCompleted(bool success)
{
    if (success)
    {
        // Operation succeeded
    }
    else
    {
        // An error occurred
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
In the event sheet:

1. Gate the button on the **Is Share Supported** condition.
2. On a trigger (e.g. **Button → On clicked**), add the **Share** action and fill its **ID** with the id of a `social.shares` entry.
3. Add the **On Share Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-share-supported","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"supported"}]},{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"share","objectClass":"PlaygamaBridge","parameters":{"id":"\"score\""}}]},{"eventType":"block","conditions":[{"id":"on-share-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
In the events sheet:

1. Gate the button on the **Is Share Supported** condition.
2. On a trigger (e.g. **Button is clicked**), add the **Share** action and fill its **Id** with the id of a `social.shares` entry.
3. Add the **On Share Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsShareSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::Share"},"parameters":["","\"score\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnShareCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]}]}],"eventsCount":3,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_share_supported
```

Use this flag to decide whether to show the share button.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    # the id of a social.shares entry — the content lives in the config
    Bridge.social.share("score", funcref(self, "_on_share_completed"))

func _on_share_completed(success):
    print(success)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    # the id of a social.shares entry — the content lives in the config
    Bridge.social.share("score", Callable(self, "_on_share_completed"))

func _on_share_completed(success):
    print(success)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_share_supported()
```

Use this flag to decide whether to show the share button.

```javascript
// the id of a social.shares entry — the content lives in the config
playgama_bridge_social_share("score")

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_share_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_share_supported()
```

Use this flag to decide whether to show the share button.

```lua
local bridge = require("bridge.bridge")

function init(self)
	-- the id of a social.shares entry — the content lives in the config
	bridge.social.share("score", function ()
		-- success
	end, function ()
		-- error
	end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isShareSupported
```

Use this flag to decide whether to show the share button.

```javascript
// the id of a social.shares entry — the content lives in the config
bridge.social.share('score')
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 5 of 25 platforms</summary>

**Supports:** `discord`, `facebook`, `msn`, `reddit`, `vk`

**Does not support:** `crazy_games`, `dlightek`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `ok`, `playgama`, `poki`, `portal`, `samsung`, `telegram`, `tiktok`, `xiaomi`, `y8`, `yandex`, `youtube`

</details>

{% hint style="info" %}
On Reddit the share is posted as a comment under the post the game runs in, so the `social.shares` entry needs a `text` there.
{% endhint %}

## Join Community

Let players join your game community, group, or page from inside the game. All options are platform-specific — set them once in the [config file](#configuration) and call the method without options:

```json
{
    "platforms": {
        "vk": {
            "social": {
                "joinCommunity": { "groupId": 123456 }
            }
        },
        "ok": {
            "social": {
                "joinCommunity": { "groupId": 123456 }
            }
        },
        "facebook": {
            "social": {
                "joinCommunity": { "isPage": true }
            }
        }
    }
}
```

* `vk`, `ok` — `groupId` is the id of your community.
* `facebook` — `isPage: true` follows the official page; without it the player joins the official group.
* `reddit` — no options required.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isJoinCommunitySupported
```

Use this flag to decide whether to show the join-community button.

```javascript
// The options are taken from the config file
bridge.social.joinCommunity()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isJoinCommunitySupported
```

Use this flag to decide whether to show the join-community button.

```csharp
private void Start()
{
    // The options are taken from the config file
    Bridge.social.JoinCommunity(OnJoinCommunityCompleted);
}

private void OnJoinCommunityCompleted(bool success)
{
    if (success)
    {
        // Operation succeeded
    }
    else
    {
        // An error occurred
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
In the event sheet:

1. Gate the button on the **Is Join Community Supported** condition.
2. On a trigger (e.g. **Button → On clicked**), add the **Join Community** action.
3. Add the **On Join Community Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-join-community-supported","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"supported"}]},{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"join-community","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-join-community-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
In the events sheet:

1. Gate the button on the **Is Join Community Supported** condition.
2. On a trigger (e.g. **Button is clicked**), add the **Join Community** action.
3. Add the **On Join Community Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsJoinCommunitySupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::JoinCommunity"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnJoinCommunityCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]}]}],"eventsCount":3,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_join_community_supported
```

Use this flag to decide whether to show the join-community button.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    # The options are taken from the config file
    Bridge.social.join_community(funcref(self, "_on_join_community_completed"))

func _on_join_community_completed(success):
    print(success)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    # The options are taken from the config file
    Bridge.social.join_community(Callable(self, "_on_join_community_completed"))

func _on_join_community_completed(success):
    print(success)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_join_community_supported()
```

Use this flag to decide whether to show the join-community button.

```javascript
// The options are taken from the config file
playgama_bridge_social_join_community()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_join_community_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_join_community_supported()
```

Use this flag to decide whether to show the join-community button.

```lua
local bridge = require("bridge.bridge")

function init(self)
	-- The options are taken from the config file
	bridge.social.join_community(function ()
		-- success
	end, function ()
		-- error
	end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isJoinCommunitySupported
```

Use this flag to decide whether to show the join-community button.

```javascript
// The options are taken from the config file
bridge.social.joinCommunity()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 4 of 25 platforms</summary>

**Supports:** `facebook`, `ok`, `reddit`, `vk`

**Does not support:** `crazy_games`, `discord`, `dlightek`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `playgama`, `poki`, `portal`, `samsung`, `telegram`, `tiktok`, `xiaomi`, `y8`, `yandex`, `youtube`

</details>

## Invite Friends

Let players invite friends to the current game session or game page.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isInviteFriendsSupported
```

Use this flag to decide whether to show the invite-friends button.

```javascript
// the id of a social.invites entry — the content lives in the config
bridge.social.inviteFriends('friends')
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isInviteFriendsSupported
```

Use this flag to decide whether to show the invite-friends button.

```csharp
private void Start()
{
    // the id of a social.invites entry — the content lives in the config
    Bridge.social.InviteFriends("friends", OnInviteFriendsCompleted);
}

private void OnInviteFriendsCompleted(bool success)
{
    if (success)
    {
        // Operation succeeded
    }
    else
    {
        // An error occurred
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
In the event sheet:

1. Gate the button on the **Is Invite Friends Supported** condition.
2. On a trigger (e.g. **Button → On clicked**), add the **Invite Friends** action and fill its **ID** with the id of a `social.invites` entry.
3. Add the **On Invite Friends Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-invite-friends-supported","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"supported"}]},{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"invite-friends","objectClass":"PlaygamaBridge","parameters":{"id":"\"friends\""}}]},{"eventType":"block","conditions":[{"id":"on-invite-friends-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
In the events sheet:

1. Gate the button on the **Is Invite Friends Supported** condition.
2. On a trigger (e.g. **Button is clicked**), add the **Invite Friends** action and fill its **Id** with the id of a `social.invites` entry.
3. Add the **On Invite Friends Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsInviteFriendsSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::InviteFriends"},"parameters":["","\"friends\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnInviteFriendsCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]}]}],"eventsCount":3,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_invite_friends_supported
```

Use this flag to decide whether to show the invite-friends button.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    # the id of a social.invites entry — the content lives in the config
    Bridge.social.invite_friends("friends", funcref(self, "_on_invite_friends_completed"))

func _on_invite_friends_completed(success):
    print(success)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    # the id of a social.invites entry — the content lives in the config
    Bridge.social.invite_friends("friends", Callable(self, "_on_invite_friends_completed"))

func _on_invite_friends_completed(success):
    print(success)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_invite_friends_supported()
```

Use this flag to decide whether to show the invite-friends button.

```javascript
// the id of a social.invites entry — the content lives in the config
playgama_bridge_social_invite_friends("friends")

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_invite_friends_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_invite_friends_supported()
```

Use this flag to decide whether to show the invite-friends button.

```lua
local bridge = require("bridge.bridge")

function init(self)
	-- the id of a social.invites entry — the content lives in the config
	bridge.social.invite_friends("friends", function ()
		-- success
	end, function ()
		-- error
	end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isInviteFriendsSupported
```

Use this flag to decide whether to show the invite-friends button.

```javascript
// the id of a social.invites entry — the content lives in the config
bridge.social.inviteFriends('friends')
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 4 of 25 platforms</summary>

**Supports:** `discord`, `facebook`, `ok`, `vk`

**Does not support:** `crazy_games`, `dlightek`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `playgama`, `poki`, `portal`, `reddit`, `samsung`, `telegram`, `tiktok`, `xiaomi`, `y8`, `yandex`, `youtube`

</details>

## Create Post

Let players create a platform post from inside the game. The post is declared in `social.posts` of the [config](#configuration); besides the common fields, an entry can hold platform-specific ones — for example, `media` in its `ok` block.

A post is created by its id, and an optional second argument travels with that one post: the game's own string, handed back as [`platform.payload`](/playgama/bridge-sdk/api/platform.md#url-parameter) when someone opens the game from it. That is what makes level sharing work — put the level into the payload, read it back on launch. A post created from an entry can also carry [rewards](#post-rewards).

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isCreatePostSupported
```

Use this flag to decide whether to show the create-post button.

```javascript
// the id of a social.posts entry, plus the payload for this one post
bridge.social.createPost('level', JSON.stringify(level))
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isCreatePostSupported
```

Use this flag to decide whether to show the create-post button.

```csharp
private void Start()
{
    // the id of a social.posts entry, plus the payload for this one post
    Bridge.social.CreatePost("level", JsonUtility.ToJson(level), OnCreatePostCompleted);
}

private void OnCreatePostCompleted(bool success)
{
    if (success)
    {
        // Operation succeeded
    }
    else
    {
        // An error occurred
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
In the event sheet:

1. Gate the button on the **Is Create Post Supported** condition.
2. On a trigger (e.g. **Button → On clicked**), add the **Create Post** action and fill its **ID** with the id of a `social.posts` entry and an optional **Payload**.
3. Add the **On Create Post Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-create-post-supported","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"supported"}]},{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"create-post","objectClass":"PlaygamaBridge","parameters":{"id":"\"gift\"","payload":"\"\""}}]},{"eventType":"block","conditions":[{"id":"on-create-post-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
In the events sheet:

1. Gate the button on the **Is Create Post Supported** condition.
2. On a trigger (e.g. **Button is clicked**), add the **Create Post** action and fill its **Id** with the id of a `social.posts` entry and an optional **Payload**.
3. Add the **On Create Post Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsCreatePostSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"SourisSurObjet"},"parameters":["CreatePostButton","","",""]}],"actions":[{"type":{"value":"PlaygamaBridge::CreatePost"},"parameters":["","\"gift\"","\"\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnCreatePostCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]}]}],"eventsCount":3,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_create_post_supported
```

Use this flag to decide whether to show the create-post button.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    # the id of a social.posts entry, plus the payload for this one post
    Bridge.social.create_post("level", to_json(level), funcref(self, "_on_create_post_completed"))

func _on_create_post_completed(success):
    print(success)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    # the id of a social.posts entry, plus the payload for this one post
    Bridge.social.create_post("level", JSON.stringify(level), Callable(self, "_on_create_post_completed"))

func _on_create_post_completed(success):
    print(success)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_create_post_supported()
```

Use this flag to decide whether to show the create-post button.

```javascript
// the id of a social.posts entry, plus the payload for this one post
playgama_bridge_social_create_post("level", json_stringify(level))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_create_post_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_create_post_supported()
```

Use this flag to decide whether to show the create-post button.

```lua
local bridge = require("bridge.bridge")

function init(self)
	-- the id of a social.posts entry, plus the payload for this one post
	bridge.social.create_post("level", json.encode(level), function ()
		-- success
	end, function ()
		-- error
	end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isCreatePostSupported
```

Use this flag to decide whether to show the create-post button.

```javascript
// the id of a social.posts entry, plus the payload for this one post
bridge.social.createPost('level', JSON.stringify(level))
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 2 of 25 platforms</summary>

**Supports:** `ok`, `reddit`

**Does not support:** `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `playgama`, `poki`, `portal`, `samsung`, `telegram`, `tiktok`, `vk`, `xiaomi`, `y8`, `yandex`, `youtube`

</details>

## Post Rewards

Posts can pay the player twice: once for opening the game from a post, and once for being the author of a post other players came through. The game declares what a post is worth, the platform backend decides who has earned it, and `getPostReward()` returns what is due right now.

### Configuration

Add `rewards` to a `social.posts` entry. A reward with no `type` is a **visit** reward — granted to whoever opens the game from that post, at most once per `rewardCooldown` seconds. A reward with `"type": "author"` goes to the player who created the post, multiplied by the number of players who came through it since the previous call:

```json
{
    "social": {
        "posts": [
            {
                "id": "gift",
                "text": "Free coins inside!",
                "rewards": [
                    { "id": "coins", "amount": 100 },                  // to whoever opens the game from this post
                    { "id": "coins", "amount": 50, "type": "author" }  // to the author, per player
                ],
                "rewardCooldown": 14400                                // seconds between visit rewards, per player
            }
        ]
    }
}
```

The `id` and `amount` of a reward mean nothing to the platform — they are your own currency and quantity, and the game grants them.

### Get Post Reward

Call it once on launch, when the flag says the platform supports it. The result is a flat list of everything owed at that moment, empty when there is nothing, so grant what you get and stay quiet otherwise. Everything returned counts as paid out, so apply the list immediately rather than asking again later.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isPostRewardSupported
```

Use this flag to decide whether to ask for rewards at all.

```javascript
bridge.social.getPostReward()
    .then(rewards => {
        rewards.forEach(reward => {
            console.log(reward.type, reward.id, reward.amount)
        })
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isPostRewardSupported
```

Use this flag to decide whether to ask for rewards at all.

```csharp
private void Start()
{
    Bridge.social.GetPostReward(OnGetPostRewardCompleted);
}

private void OnGetPostRewardCompleted(bool success, List<PostReward> rewards)
{
    if (success)
    {
        foreach (var reward in rewards)
        {
            Debug.Log($"{reward.type}: {reward.id} x{reward.amount}");
        }
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
Gate everything on the **Is Post Reward Supported** condition, call the `Get Post Reward` action, then handle the `On Get Post Reward Completed` trigger. Read the result with the `PostRewardsCount`, `PostRewardId`, `PostRewardAmount`, `PostRewardType` expressions, or take everything at once with `PostRewardsAsJSON`.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-post-reward-supported","objectClass":"PlaygamaBridge"}],"actions":[{"id":"get-post-reward","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-get-post-reward-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"for","objectClass":"System","parameters":{"name":"\"rewards\"","start-index":"0","end-index":"PlaygamaBridge.PostRewardsCount - 1"}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"PlaygamaBridge.PostRewardId(loopindex(\"rewards\")) & \" x\" & PlaygamaBridge.PostRewardAmount(loopindex(\"rewards\"))"}}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
Gate everything on the **Is Post Reward Supported** condition, call the `Get Post Reward` action, then handle the `On Get Post Reward Completed` condition. Read the result with the `PlaygamaBridge::PostRewardsCount()`, `PlaygamaBridge::PostRewardId(index)`, `PlaygamaBridge::PostRewardAmount(index)`, `PlaygamaBridge::PostRewardType(index)` expressions, or take everything at once with `PlaygamaBridge::PostRewardsAsJSON()`.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsPostRewardSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"PlaygamaBridge::GetPostReward"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnGetPostRewardCompleted"},"parameters":["",""]}],"actions":[{"type":{"value":"SetNumberVariable"},"parameters":["CurrentIndex","=","0"]}],"events":[{"type":"BuiltinCommonInstructions::Repeat","repeatExpression":"PlaygamaBridge::PostRewardsCount()","conditions":[],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["PlaygamaBridge::PostRewardId(CurrentIndex)","\"info\"",""]},{"type":{"value":"SetNumberVariable"},"parameters":["CurrentIndex","+","1"]}]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_post_reward_supported
```

Use this flag to decide whether to ask for rewards at all.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    Bridge.social.get_post_reward(funcref(self, "_on_get_post_reward_completed"))

func _on_get_post_reward_completed(success, rewards):
    if success:
        for reward in rewards:
            print(reward.type, ": ", reward.id, " x", reward.amount)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    Bridge.social.get_post_reward(Callable(self, "_on_get_post_reward_completed"))

func _on_get_post_reward_completed(success, rewards):
    if success:
        for reward in rewards:
            print(reward.type, ": ", reward.id, " x", reward.amount)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_post_reward_supported()
```

Use this flag to decide whether to ask for rewards at all.

```javascript
playgama_bridge_social_get_post_reward()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_get_post_reward_callback" {
    if async_load[? "success"] {
        var rewards = json_parse(async_load[? "data"])
        for (var i = 0; i < array_length(rewards); i += 1) {
            var reward = rewards[i]
            // reward.id, reward.amount, reward.type
        }
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_post_reward_supported()
```

Use this flag to decide whether to ask for rewards at all.

```lua
local bridge = require("bridge.bridge")

function init(self)
	bridge.social.get_post_reward(
		function (_, rewards)
			for _, reward in ipairs(rewards) do
				print(reward.type, reward.id, reward.amount)
			end
		end,
		function ()
			-- error
		end
	)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isPostRewardSupported
```

Use this flag to decide whether to ask for rewards at all.

```javascript
bridge.social.getPostReward()
    .then(rewards => {
        rewards.forEach(reward => {
            console.log(reward.type, reward.id, reward.amount)
        })
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

A `PostReward` looks like this:

```javascript
{
    id: 'coins',        // your currency, from the config entry
    amount: 100,        // for an author reward, already multiplied by the players counted
    type: 'visit'       // 'visit' | 'author'
}
```

On a platform that does not support post rewards the call rejects, so keep it behind the flag.

<details>

<summary>Platform support · 1 of 25 platforms</summary>

**Supports:** `reddit`

**Does not support:** `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `ok`, `playgama`, `poki`, `portal`, `samsung`, `telegram`, `tiktok`, `vk`, `xiaomi`, `y8`, `yandex`, `youtube`

</details>

## Add to Favorites

Let players add the game to the platform's favorites or bookmarks.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isAddToFavoritesSupported
```

Use this flag to decide whether to show the add-to-favorites button.

```javascript
bridge.social.addToFavorites()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isAddToFavoritesSupported
```

Use this flag to decide whether to show the add-to-favorites button.

```csharp
private void Start()
{
    Bridge.social.AddToFavorites(OnAddToFavoritesCompleted);
}

private void OnAddToFavoritesCompleted(bool success)
{
    if (success)
    {
        // Operation succeeded
    }
    else
    {
        // An error occurred
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
In the event sheet:

1. Gate the button on the **Is Add To Favorites Supported** condition.
2. On a trigger (e.g. **Button → On clicked**), add the **Add To Favorites** action.
3. Add the **On Add To Favorites Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-add-to-favorites-supported","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"supported"}]},{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"add-to-favorites","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-add-to-favorites-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
In the events sheet:

1. Gate the button on the **Is Add To Favorites Supported** condition.
2. On a trigger (e.g. **Button is clicked**), add the **Add To Favorites** action.
3. Add the **On Add To Favorites Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsAddToFavoritesSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddToFavorites"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnAddToFavoritesCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]}]}],"eventsCount":3,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_add_to_favorites_supported
```

Use this flag to decide whether to show the add-to-favorites button.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    Bridge.social.add_to_favorites(funcref(self, "_on_add_to_favorites_completed"))

func _on_add_to_favorites_completed(success):
    print(success)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    Bridge.social.add_to_favorites(Callable(self, "_on_add_to_favorites_completed"))

func _on_add_to_favorites_completed(success):
    print(success)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_add_to_favorites_supported()
```

Use this flag to decide whether to show the add-to-favorites button.

```javascript
playgama_bridge_social_add_to_favorites()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_add_to_favorites_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_add_to_favorites_supported()
```

Use this flag to decide whether to show the add-to-favorites button.

```lua
local bridge = require("bridge.bridge")

function init(self)
    bridge.social.add_to_favorites(function ()
        -- success
    end, function ()
        -- error
    end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isAddToFavoritesSupported
```

Use this flag to decide whether to show the add-to-favorites button.

```javascript
bridge.social.addToFavorites()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 2 of 25 platforms</summary>

**Supports:** `tiktok`, `vk`

**Does not support:** `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `ok`, `playgama`, `poki`, `portal`, `reddit`, `samsung`, `telegram`, `xiaomi`, `y8`, `yandex`, `youtube`

</details>

## Add to Home Screen

Let players add a shortcut to the game on their home screen or launcher.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isAddToHomeScreenSupported
```

Use this flag to decide whether to show the add-to-home-screen button.

```javascript
bridge.social.addToHomeScreen()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isAddToHomeScreenSupported
```

Use this flag to decide whether to show the add-to-home-screen button.

```csharp
private void Start()
{
    Bridge.social.AddToHomeScreen(OnAddToHomeScreenCompleted);
}

private void OnAddToHomeScreenCompleted(bool success)
{
    if (success)
    {
        // Operation succeeded
    }
    else
    {
        // An error occurred
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
In the event sheet:

1. Gate the button on the **Is Add To Home Screen Supported** condition.
2. On a trigger (e.g. **Button → On clicked**), add the **Add To Home Screen** action.
3. Add the **On Add To Home Screen Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-add-to-home-screen-supported","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"supported"}]},{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"add-to-home-screen","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-add-to-home-screen-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
In the events sheet:

1. Gate the button on the **Is Add To Home Screen Supported** condition.
2. On a trigger (e.g. **Button is clicked**), add the **Add To Home Screen** action.
3. Add the **On Add To Home Screen Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsAddToHomeScreenSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddToHomeScreen"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnAddToHomeScreenCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]}]}],"eventsCount":3,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_add_to_home_screen_supported
```

Use this flag to decide whether to show the add-to-home-screen button.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    Bridge.social.add_to_home_screen(funcref(self, "_on_add_to_home_screen_completed"))

func _on_add_to_home_screen_completed(success):
    print(success)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    Bridge.social.add_to_home_screen(Callable(self, "_on_add_to_home_screen_completed"))

func _on_add_to_home_screen_completed(success):
    print(success)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_add_to_home_screen_supported()
```

Use this flag to decide whether to show the add-to-home-screen button.

```javascript
playgama_bridge_social_add_to_home_screen()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_add_to_home_screen_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_add_to_home_screen_supported()
```

Use this flag to decide whether to show the add-to-home-screen button.

```lua
local bridge = require("bridge.bridge")

function init(self)
    bridge.social.add_to_home_screen(function ()
        -- success
    end, function ()
        -- error
    end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isAddToHomeScreenSupported
```

Use this flag to decide whether to show the add-to-home-screen button.

```javascript
bridge.social.addToHomeScreen()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 4 of 25 platforms</summary>

**Supports:** `samsung`, `tiktok`, `vk`, `yandex`

**Does not support:** `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `ok`, `playgama`, `poki`, `portal`, `reddit`, `telegram`, `xiaomi`, `y8`, `youtube`

</details>

## Rate Game

Open the platform's rating flow. Trigger it after a positive moment, such as completing a level or returning after several sessions.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.social.isRateSupported
```

Use this flag to decide whether to show the rate-game button.

```javascript
bridge.social.rate()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isRateSupported
```

Use this flag to decide whether to show the rate-game button.

```csharp
private void Start()
{
    Bridge.social.Rate(OnRateCompleted);
}

private void OnRateCompleted(bool success)
{
    if (success)
    {
        // Operation succeeded
    }
    else
    {
        // An error occurred
    }
}
```

{% endtab %}

{% tab title="Construct 3" %}
In the event sheet:

1. Gate the button on the **Is Rate Supported** condition.
2. On a trigger (e.g. **Button → On clicked**), add the **Rate** action.
3. Add the **On Rate Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"is-rate-supported","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"supported"}]},{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"rate","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-rate-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"type":"comment","text":"success"}]}]}]}
```

</details>
{% endtab %}

{% tab title="GDevelop" %}
In the events sheet:

1. Gate the button on the **Is Rate Supported** condition.
2. On a trigger (e.g. **Button is clicked**), add the **Rate** action.
3. Add the **On Rate Completed** condition and check **Is Last Action Completed Successfully**.

<details>

<summary>Copy This Example</summary>

```
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsRateSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[{"type":{"value":"PlaygamaBridge::Rate"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnRateCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]}]}],"eventsCount":3,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}
```

</details>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_rate_supported
```

Use this flag to decide whether to show the rate-game button.

{% tabs %}
{% tab title="Godot 3.x" %}

```gdscript
func _ready():
    Bridge.social.rate(funcref(self, "_on_rate_completed"))

func _on_rate_completed(success):
    print(success)
```

{% endtab %}

{% tab title="Godot 4.x" %}

```gdscript
func _ready():
    Bridge.social.rate(Callable(self, "_on_rate_completed"))

func _on_rate_completed(success):
    print(success)
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_rate_supported()
```

Use this flag to decide whether to show the rate-game button.

```javascript
playgama_bridge_social_rate()

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_social_rate_callback" {
    if async_load[? "success"] {
        // your logic
    }
}
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_rate_supported()
```

Use this flag to decide whether to show the rate-game button.

```lua
local bridge = require("bridge.bridge")

function init(self)
    bridge.social.rate(function ()
        -- success
    end, function ()
        -- error
    end)
end
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isRateSupported
```

Use this flag to decide whether to show the rate-game button.

```javascript
bridge.social.rate()
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

<summary>Platform support · 3 of 25 platforms</summary>

**Supports:** `microsoft_store`, `ok`, `yandex`

**Does not support:** `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `msn`, `playgama`, `poki`, `portal`, `reddit`, `samsung`, `telegram`, `tiktok`, `vk`, `xiaomi`, `y8`, `youtube`

</details>
