> 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

{% hint style="info" %}
You are reading the documentation for Bridge SDK **v2**. If you need the obsolete v1 documentation, see [Documentation (v1)](https://wiki.playgama.com/playgama/bridge-sdk-v1).
{% endhint %}

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

Static options can live in the [config](/playgama/bridge-sdk/config.md) instead of code: put shared values in the top-level `social[method]` block and platform-specific values in `platforms[id].social[method]`. Options passed at call time override the config.

```json
{
    "social": {
        "share": { "url": "https://t.me/mygame" }
    },
    "platforms": {
        "vk": {
            "social": {
                "joinCommunity": { "groupId": 123456 }
            }
        }
    }
}
```

## 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
let options = {
    text: 'A text message to be shared',
    url: 'https://your-game-link',
    image: 'https://your-game.com/cover.png',
}

bridge.social.share(options)
    .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()
{
    var options = new Dictionary<string, object>();
    options.Add("text", "A text message to be shared");
    options.Add("url", "https://your-game-link");
    options.Add("image", "https://your-game.com/cover.png");

    Bridge.social.Share(options, 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 platform-specific options with **Add Action Parameter** (branch on `PlaygamaBridge.PlatformId`), then add the **Share** action.
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":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"vk\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"link\"","value":"\"YOUR_LINK\""}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"facebook\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"image\"","value":"\"A base64 encoded image to be shared\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"text\"","value":"\"A text message to be shared\""}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"msn\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"title\"","value":"\"A title to display\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"image\"","value":"\"A base64 encoded image or image URL to be shared\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"text\"","value":"\"A text message to be shared\""}}]},{"eventType":"block","conditions":[],"actions":[{"id":"share","objectClass":"PlaygamaBridge"}]}]},{"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 platform-specific options with **Add Action Parameter** (branch on `PlaygamaBridge::PlatformId()`), then add the **Share** action.
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":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"vk\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"link\"","\"YOUR_LINK\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"facebook\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"image\"","\"A base64 encoded image to be shared\"",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"text\"","\"A text message to be shared\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"msn\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"title\"","\"A title to display\"",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"image\"","\"A base64 encoded image or image URL to be shared\"",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"text\"","\"A text message to be shared\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::Share"},"parameters":["",""]}]}]},{"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():
    var options = {
        "text": "A text message to be shared",
        "url": "https://your-game-link",
        "image": "https://your-game.com/cover.png"
    }

    Bridge.social.share(options, funcref(self, "_on_share_completed"))

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

{% endtab %}

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

```gdscript
func _ready():
    var options = {
        "text": "A text message to be shared",
        "url": "https://your-game-link",
        "image": "https://your-game.com/cover.png"
    }

    Bridge.social.share(options, 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
var options = {
    "text": "A text message to be shared",
    "url": "https://your-game-link",
    "image": "https://your-game.com/cover.png"
}

playgama_bridge_social_share(json_stringify(options))

// 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.

<pre class="language-lua"><code class="lang-lua">local bridge = require("bridge.bridge")

function init(self)
<strong>	local options = {
</strong>		text = "A text message to be shared",
		url = "https://your-game-link",
		image = "https://your-game.com/cover.png"
	}

	bridge.social.share(options, function ()
		-- success
	end, function ()
		-- error
	end)
end
</code></pre>

{% endtab %}

{% tab title="Cocos Creator" %}

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

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

```javascript
let options = {
    text: 'A text message to be shared',
    url: 'https://your-game-link',
    image: 'https://your-game.com/cover.png',
}

bridge.social.share(options)
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

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

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

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

</details>

## 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(new Dictionary<string, object>(), 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(null, 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(null, 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(nil, 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 26 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`, `playdeck`, `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
let options = {
    text: 'A text message',
    image: 'https://your-game.com/cover.png',
}

bridge.social.inviteFriends(options)
    .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()
{
    var options = new Dictionary<string, object>();
    options.Add("text", "A text message");
    options.Add("image", "https://your-game.com/cover.png");

    Bridge.social.InviteFriends(options, 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 platform-specific options with **Add Action Parameter** (branch on `PlaygamaBridge.PlatformId`), then add the **Invite Friends** action.
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":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"ok\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"text\"","value":"\"Hello World!\""}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"facebook\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"image\"","value":"\"A base64 encoded image to be shared\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"text\"","value":"\"A text message\""}}]},{"eventType":"block","conditions":[],"actions":[{"id":"invite-friends","objectClass":"PlaygamaBridge"}]}]},{"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 platform-specific options with **Add Action Parameter** (branch on `PlaygamaBridge::PlatformId()`), then add the **Invite Friends** action.
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::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"success\"","\"info\"",""]}]},{"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\"",""]}]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::JoinCommunity"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"facebook\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"image\"","\"A base64 encoded image to be shared\"",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"text\"","\"A text message to be shared.\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"ok\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"text\"","\"Hello World!\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PanelSpriteButton::PanelSpriteButton::IsClicked"},"parameters":["Button",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"ok\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"text\"","\"Hello World!\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"facebook\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"image\"","\"A base64 encoded image to be shared\"",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"text\"","\"A text message to be shared.\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::JoinCommunity"},"parameters":["",""]}]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsInviteFriendsSupported"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"supported\"","\"info\"",""]}]}],"eventsCount":7,"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():
    var options = {
        "text": "A text message",
        "image": "https://your-game.com/cover.png"
    }

    Bridge.social.invite_friends(options, funcref(self, "_on_invite_friends_completed"))

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

{% endtab %}

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

```gdscript
func _ready():
    var options = {
        "text": "A text message",
        "image": "https://your-game.com/cover.png"
    }

    Bridge.social.invite_friends(options, 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
var options = {
    "text": "A text message",
    "image": "https://your-game.com/cover.png"
}

playgama_bridge_social_invite_friends(json_stringify(options))

// 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)
	local options = {
		text = "A text message",
		image = "https://your-game.com/cover.png"
	}

	bridge.social.invite_friends(options, 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
let options = {
    text: 'A text message',
    image: 'https://your-game.com/cover.png',
}

bridge.social.inviteFriends(options)
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

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

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

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

</details>

## Create Post

Let players create a platform post from inside the game. Besides the common options, a platform can accept its own fields — for example, `media` on `ok`.

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

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

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

```javascript
let options = {
    text: 'Hello World!',
    // ok-specific media post
    media: [
        {
            'type': 'link',
            'url': 'https://apiok.ru'
        },
        {
            'type': 'poll',
            'question': 'Do you like our API?',
            'answers': [
                { 'text': 'Yes' },
                { 'text': 'No' }
            ],
            'options': 'SingleChoice,AnonymousVoting'
        }
    ]
}

bridge.social.createPost(options)
    .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()
{
    var options = new Dictionary<string, object>();
    options.Add("text", "Hello World!");

    var media = new object[]
    {
        new Dictionary<string, object>
        {
            { "type", "link" },
            { "url", "https://apiok.ru" },
        },
        new Dictionary<string, object>
        {
            { "type", "poll" },
            { "question", "Do you like our API?" },
            {
                "answers",
                new object[]
                {
                    new Dictionary<string, object>
                    {
                        { "text", "Yes" },
                    },
                    new Dictionary<string, object>
                    {
                        { "text", "No" },
                    }
                }
            },
            { "options", "SingleChoice,AnonymousVoting" },
        },
    };

    options.Add("media", media);

    Bridge.social.CreatePost(options, 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 platform-specific options with **Add Action Parameter** (branch on `PlaygamaBridge.PlatformId`), then add the **Create Post** action.
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":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"ok\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"media.0.type\"","value":"\"text\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"media.0.text\"","value":"\"Hello World!\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"media.1.type\"","value":"\"link\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"media.1.url\"","value":"\"https://apiok.ru\""}}]},{"eventType":"block","conditions":[],"actions":[{"id":"create-post","objectClass":"PlaygamaBridge"}]}]},{"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 platform-specific options with **Add Action Parameter** (branch on `PlaygamaBridge::PlatformId()`), then add the **Create Post** action.
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":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"ok\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"media.0.type\"","\"text\"",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"media.0.text\"","\"HelloWorld\" ",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"media.1.type\"","\"link\" ",""]},{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"media.1.url\"","\"https://apiok.ru\" ",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::CreatePost"},"parameters":["",""]}]}]},{"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():
    var options = {
        "text": "Hello World!",
        "media":[
            {
                "type": "link",
                "url": "https://apiok.ru"
            },
            {
                "type": "poll",
                "question": "Do you like our API?",
                "answers": [
                    { "text": "Yes" },
                    { "text": "No" }
                ],
                "options": "SingleChoice,AnonymousVoting"
            }
        ]
    }

    Bridge.social.create_post(options, funcref(self, "_on_create_post_completed"))

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

{% endtab %}

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

```gdscript
func _ready():
    var options = {
        "text": "Hello World!",
        "media":[
            {
                "type": "link",
                "url": "https://apiok.ru"
            },
            {
                "type": "poll",
                "question": "Do you like our API?",
                "answers": [
                    { "text": "Yes" },
                    { "text": "No" }
                ],
                "options": "SingleChoice,AnonymousVoting"
            }
        ]
    }

    Bridge.social.create_post(options, 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
var options = {
    "text": "Hello World!",
    "media": [
        {
            "type": "link",
            "url": "https://apiok.ru"
        },
        {
            "type": "poll",
            "question": "Do you like our API?",
            "answers": [
                { "text": "Yes" },
                { "text": "No" }
            ],
            "options": "SingleChoice,AnonymousVoting"
        }
    ]
}

playgama_bridge_social_create_post(json_stringify(options))

// 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)
	local options = {
		text = "Hello World!",
		media = {
			{
				type = "link",
				url = "https://apiok.ru"
			},
			{
				type = "poll",
				question = "Do you like our API?",
				answers = {
					{ text = "Yes" },
					{ text = "No" }
				},
				options = "SingleChoice,AnonymousVoting"
			}
		}
	}

	bridge.social.create_post(options, 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
let options = {
    text: 'Hello World!',
    media: [
        {
            'type': 'link',
            'url': 'https://apiok.ru'
        },
        {
            'type': 'poll',
            'question': 'Do you like our API?',
            'answers': [
                { 'text': 'Yes' },
                { 'text': 'No' }
            ],
            'options': 'SingleChoice,AnonymousVoting'
        }
    ]
}

bridge.social.createPost(options)
    .then(() => {
        // success
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

<details>

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

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

**Does not support:** `crazy_games`, `discord`, `dlightek`, `facebook`, `game_distribution`, `gamepush`, `gamesnacks`, `huawei`, `jio_games`, `lagged`, `microsoft_store`, `msn`, `playdeck`, `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 26 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`, `playdeck`, `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 26 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`, `playdeck`, `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 26 platforms</summary>

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

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

</details>
