> 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-v1/bridge-sdk/api/social.md).

# Social

Social features help players invite friends, return more often, and share results. **Every method here is optional** — pick only the ones that fit your game and target platforms. None are required for SDK initialization.

{% 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 %}

## 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 = { }

switch (bridge.platform.id) {
    case 'vk':
        options = {
            link: 'YOUR_LINK'
        }
        break
    case 'facebook':
        options = {
            image: 'A base64 encoded image to be shared', 
            text: 'A text message to be shared.',
        }
        break
    case 'msn':
        options = {
            title: 'A title to display',
            image: 'A base64 encoded image or image URL to be shared', 
            text: 'A text message to be shared.',
        }
        break
}

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>();

    switch (Bridge.platform.id)
    {
        case "vk":
            options.Add("link", "YOUR_LINK");
            break;
        case "facebook":
            options.Add("image", "A base64 encoded image to be shared");
            options.Add("text", "A text message to be shared");
            break;
        case "msn":
            options.Add("title", "A title to display");
            options.Add("image", "A base64 encoded image or image URL to be shared");
            options.Add("text", "A text message to be shared");
            break;
    }

    Bridge.social.Share(options, OnShareCompleted);
}

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

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/14NSPuvBq0eUNyyRr2MY" alt=""><figcaption></figcaption></figure>

<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" %}

<figure><img src="/files/a9rbElKsjumkTB3PXbS4" alt=""><figcaption></figcaption></figure>

<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

    match Bridge.platform.id:
        "vk":
            options = {
                "link": "YOUR_LINK"
            }
        "facebook":
            options = {
                "image": "A base64 encoded image to be shared", 
                "text": "A text message to be shared"
            }
        "msn":
            options = {
                "title": "A title to display",
                "image": "A base64 encoded image or image URL to be shared", 
                "text": "A text message to be shared"
            }

    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

    match Bridge.platform.id:
        "vk":
            options = {
                "link": "YOUR_LINK"
            }
        "facebook":
            options = {
                "image": "A base64 encoded image to be shared", 
                "text": "A text message to be shared"
            }
        "msn":
            options = {
                "title": "A title to display",
                "image": "A base64 encoded image or image URL to be shared", 
                "text": "A text message to be shared"
            }

    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
switch playgama_bridge_platform_id() {
    case "vk":
	options = {
    	    "link": "YOUR_LINK"
        }
        break
    case "facebook":
        options = {
            "image": "A base64 encoded image to be shared", 
            "text": "A text message to be shared.",
        }
        break
    case "msn":
        options = {
            "title": "A title to display",
            "image": "A base64 encoded image or image URL to be shared", 
            "text": "A text message to be shared.",
        }
        break
}

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>		vk = {
			link = "YOUR_LINK"
		},
		facebook = {
			image = "A base64 encoded image to be shared", 
			text = "A text message to be shared.",
		},
		msn = {
			title = "A title to display",
			image = "A base64 encoded image or image URL to be shared", 
			text = "A text message to be shared.",
		}
	}

	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 = { }

switch (bridge.platform.id) {
    case 'vk':
        options = {
            link: 'YOUR_LINK'
        }
        break
    case 'facebook':
        options = {
            image: 'A base64 encoded image to be shared', 
            text: 'A text message to be shared.',
        }
        break
    case 'msn':
        options = {
            title: 'A title to display',
            image: 'A base64 encoded image or image URL to be shared', 
            text: 'A text message to be shared.',
        }
        break
}

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

{% endtab %}
{% endtabs %}

<details>

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

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

**Does not support:** `absolute_games`, `bitquest`, `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, page, or group from inside the game.

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

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

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

```javascript
let options = { }

switch (bridge.platform.id) {
    case 'vk':
        options = {
            groupId: YOUR_GROUP_ID
        }
        break
    case 'ok':
        options = {
            groupId: YOUR_GROUP_ID
        }
        break
    case 'facebook':
        options = {
            isPage: true // if isPage = true, invite to page, else invite to group
        }
        break
}

bridge.social.joinCommunity(options)
    .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()
{
    var options = new Dictionary<string, object>();

    switch (Bridge.platform.id)
    {
        case "vk":
            options.Add("groupId", YOUR_GROUP_ID);
            break;
        case "ok":
            options.Add("groupId", YOUR_GROUP_ID);
            break;
        case "facebook":
            options.Add("isPage", true); // if isPage = true, invite to page, else invite to group
            break;
    }

    Bridge.social.JoinCommunity(options, OnJoinCommunityCompleted);
}

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

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/B4Qvpc4O6FLXSkrmqq1Z" alt=""><figcaption></figcaption></figure>

<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":[],"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":"\"groupId\"","value":"\"YOUR_GROUP_ID\""}}]},{"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":"\"groupId\"","value":"\"YOUR_GROUP_ID\""}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"facebook\""}}],"actions":[{"id":"add-bool-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"isPage\"","value":true}}]},{"eventType":"block","conditions":[],"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" %}

<figure><img src="/files/HwRnQoZ50yC2lWQQhMrX" alt=""><figcaption></figcaption></figure>

<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":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"vk\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"groupId\"","\"YOUR_GROUP_ID\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"BuiltinCommonInstructions::CompareStrings"},"parameters":["PlaygamaBridge::PlatformId()","=","\"ok\""]}],"actions":[{"type":{"value":"PlaygamaBridge::AddActionParameter"},"parameters":["","\"groupId\"","\"YOUR_GROUP_ID\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[],"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():
    var options

    match Bridge.platform.id:
        "vk":
            options = {
                "groupId": YOUR_GROUP_ID
            }
        "ok":
            options = {
                "groupId": YOUR_GROUP_ID
            }
        "facebook":
            # if isPage = true, invite to page, else invite to group
            options = {
                "isPage": true
            }

    Bridge.social.join_community(options, funcref(self, "_on_join_community_completed"))

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

{% endtab %}

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

```gdscript
func _ready():
    var options

    match Bridge.platform.id:
        "vk":
            options = {
                "groupId": YOUR_GROUP_ID
            }
        "ok":
            options = {
                "groupId": YOUR_GROUP_ID
            }
        "facebook":
            # if isPage = true, invite to page, else invite to group
            options = {
                "isPage": true
            }

    Bridge.social.join_community(options, 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
var options
switch playgama_bridge_platform_id() {
    case "vk":
	options = {
    	    "groupId": "YOUR_GROUP_ID"
        }
        break
    case "ok":
        options = {
    	    "groupId": "YOUR_GROUP_ID"
        }
        break
    case "facebook":
        options = {
    	    "isPage": true  // if isPage = true, invite to page, else invite to group
        }
        break
}

playgama_bridge_social_join_community(json_stringify(options))

// 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)
	local options = {
		vk = {
			groupId = "YOUR_GROUP_ID"
		},
		ok = {
			groupId = "YOUR_GROUP_ID"
		},
		-- if isPage = true, invite to page, else invite to group
		facebook = {
			isPage = true 
		}
	}

	bridge.social.join_community(options, 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
let options = { }

switch (bridge.platform.id) {
    case 'vk':
        options = {
            groupId: YOUR_GROUP_ID
        }
        break
    case 'ok':
        options = {
            groupId: YOUR_GROUP_ID
        }
        break
    case 'facebook':
        options = {
            isPage: true // if isPage = true, invite to page, else invite to group
        }
        break
}

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

{% endtab %}
{% endtabs %}

<details>

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

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

**Does not support:** `absolute_games`, `bitquest`, `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 = { }

switch (bridge.platform.id) {
    case 'ok':
        options = {
            text: 'Hello World!'
        }
        break
    case 'facebook':
        options = {
            image: 'A base64 encoded image to be shared',  
            text: 'A text message',
        }
        break
}

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>();

    switch (Bridge.platform.id)
    {
        case "ok":
            options.Add("text", "Hello World!");
            break;
        case "facebook":
            options.Add("image", "A base64 encoded image to be shared");
            options.Add("text", "A text message to be shared");
            break;
    }

    Bridge.social.InviteFriends(options, OnInviteFriendsCompleted);
}

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

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/l0hwe5Ad5v0L0dXwc6m8" alt=""><figcaption></figcaption></figure>

<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" %}

<figure><img src="/files/dPkfr0vbu3XWrfQMgA5b" alt=""><figcaption></figcaption></figure>

<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

    match Bridge.platform.id:
        "ok":
            options = {
                "text": "Hello World!"
            }
        "facebook":
            options = {
                "image": "A base64 encoded image to be shared", 
                "text": "A text message to be shared"
            }

    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

    match Bridge.platform.id:
        "ok":
            options = {
                "text": "Hello World!"
            }
        "facebook":
            options = {
                "image": "A base64 encoded image to be shared", 
                "text": "A text message to be shared"
            }
    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
switch playgama_bridge_platform_id() {
    case "ok":
	options = {
    	    "text": "Hello World!"
        }
        break
    case "facebook":
        options = {
    	    "image": "A base64 encoded image to be shared",  
            "text": "A text message",
        }
        break
}

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 = {
		ok = {
			text = "Hello World!"
		},
		facebook = {
			image = "A base64 encoded image to be shared",  
            		text = "A text message",
		}
	}

	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 = { }

switch (bridge.platform.id) {
    case 'ok':
        options = {
            text: 'Hello World!'
        }
        break
    case 'facebook':
        options = {
            image: 'A base64 encoded image to be shared',  
            text: 'A text message',
        }
        break
}

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

{% endtab %}
{% endtabs %}

<details>

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

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

**Does not support:** `absolute_games`, `bitquest`, `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. Use only on platforms that support this flow.

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

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

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

```javascript
let options = { }

switch (bridge.platform.id) {
    case 'ok':
        options = {
            media: [
                {
                    'type': 'text',
                    'text': 'Hello World!'
                },
                {
                    'type': 'link',
                    'url': 'https://apiok.ru'
                },
                {
                    'type': 'poll',
                    'question': 'Do you like our API?',
                    'answers': [
                        { 'text': 'Yes' },
                        { 'text': 'No' }
                    ],
                    'options': 'SingleChoice,AnonymousVoting'
                }
            ]
        }
        break
}

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>();

    switch (Bridge.platform.id)
    {
        case "ok":
            var media = new object[]
            {
                new Dictionary<string, object>
                {
                    { "type", "text" },
                    { "text", "Hello World!" },
                },
                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);
            break;
    }

    Bridge.social.CreatePost(options, OnCreatePostCompleted);
}

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

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/TLJceXBbSwHTchdWzmnE" alt=""><figcaption></figcaption></figure>

<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" %}

<figure><img src="/files/JdHwL1DB70eZaYflVQOy" alt=""><figcaption></figcaption></figure>

<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

    match Bridge.platform.id:
        "ok":
            options = {
                "media":[
                    {
                        "type": "text",
                        "text": "Here you can see odnoklassniki API docs(click the link)"
                    },
                    {
                        "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

    match Bridge.platform.id:
        "ok":
            options = {
                "media":[
                    {
                        "type": "text",
                        "text": "Here you can see odnoklassniki API docs(click the link)"
                    },
                    {
                        "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
switch playgama_bridge_platform_id() {
    case "ok":
	options = {
            "media": [
                {
                    "type": "text",
                    "text": "Hello World!"
                },
                {
                    "type": "link",
                    "url": "https://apiok.ru"
                },
                {
                    "type": "poll",
                    "question": "Do you like our API?",
                    "answers": [
                        { "text": "Yes" },
                        { "text": "No" }
                    ],
                    "options": "SingleChoice,AnonymousVoting"
                }
            ]
        }
        break
}

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 = {
		ok = {
			media = {
				{
					type = "text",
					text = "Hello World!"
				},
				{
					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 = { }

switch (bridge.platform.id) {
    case 'ok':
        options = {
            media: [
                {
                    'type': 'text',
                    'text': 'Hello World!'
                },
                {
                    'type': 'link',
                    'url': 'https://apiok.ru'
                },
                {
                    'type': 'poll',
                    'question': 'Do you like our API?',
                    'answers': [
                        { 'text': 'Yes' },
                        { 'text': 'No' }
                    ],
                    'options': 'SingleChoice,AnonymousVoting'
                }
            ]
        }
        break
}

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

{% endtab %}
{% endtabs %}

<details>

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

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

**Does not support:** `absolute_games`, `bitquest`, `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" %}

<figure><img src="/files/YwjhOKR9LGhHRXk3AgBs" alt=""><figcaption></figcaption></figure>

<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" %}

<figure><img src="/files/elQkim4nXrIVrWQ2jN0J" alt=""><figcaption></figcaption></figure>

<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 28 platforms</summary>

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

**Does not support:** `absolute_games`, `bitquest`, `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" %}

<figure><img src="/files/RluTPZWXkSZUQQmFWLU1" alt=""><figcaption></figcaption></figure>

<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" %}

<figure><img src="/files/6yocZOngeQSbiDEGYayt" alt=""><figcaption></figcaption></figure>

<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 28 platforms</summary>

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

**Does not support:** `absolute_games`, `bitquest`, `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" %}

<figure><img src="/files/QeCuvEuFl9U39ZwquIap" alt=""><figcaption></figcaption></figure>

<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" %}

<figure><img src="/files/dT5khLGn8oUtlFZxh31t" alt=""><figcaption></figcaption></figure>

<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 28 platforms</summary>

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

**Does not support:** `absolute_games`, `bitquest`, `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>

## External Links

Check whether the platform allows links that leave the host environment, such as your official site, support page, or community page.

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

```javascript
bridge.social.isExternalLinksAllowed
```

{% endtab %}

{% tab title="Unity" %}

```java
Bridge.social.isExternalLinksAllowed
```

{% endtab %}

{% tab title="Construct 3" %}

<figure><img src="/files/b9ark06XfjS02SxSCtNE" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="GDevelop" %}

<figure><img src="/files/yDmjh5PTOJzoKRBX5ri3" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Godot" %}

```gdscript
Bridge.social.is_external_links_allowed
```

{% endtab %}

{% tab title="GameMaker" %}

```javascript
playgama_bridge_social_is_external_links_allowed()
```

{% endtab %}

{% tab title="Defold" %}

```lua
bridge.social.is_external_links_allowed()
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.social.isExternalLinksAllowed
```

{% endtab %}
{% endtabs %}

If this is `false`, hide external links or replace them with platform-approved navigation.

<details>

<summary>Platform support · 19 of 28 platforms</summary>

**Supports (external links allowed):** `bitquest`, `crazy_games`, `discord`, `dlightek`, `facebook`, `gamepush`, `gamesnacks`, `huawei`, `lagged`, `microsoft_store`, `msn`, `playdeck`, `portal`, `reddit`, `telegram`, `tiktok`, `vk`

**Does not support (external links blocked):** `absolute_games`, `game_distribution`, `jio_games`, `ok`, `playgama`, `poki`, `samsung`, `yandex`, `youtube` ,`xiaomi`, `y8`

</details>
