For the complete documentation index, see llms.txt. This page is also available as Markdown.

Social

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

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.

Configuration

Social content and settings live in the config, not in code. The game passes only the id of a config entry to share, inviteFriends and createPost, and calls joinCommunity without arguments — so the same code works on every platform, and the texts can be changed without rebuilding the game.

Content by id

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

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

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

The settings of Join Community go to social.joinCommunity, usually per platform in platforms.<id>.social.joinCommunity.

Writing the content in the config keeps one text per platform in one place, and it is what lets a post carry rewards — the platform backend reads them from the same entry.

Share

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

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

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

In the event sheet:

  1. Gate the button on the Is Share Supported condition.

  2. On a trigger (e.g. Button → On clicked), add the Share action and fill its ID with the id of a social.shares entry.

  3. Add the On Share Completed condition and check Is Last Action Completed Successfully.

Copy This Example

In the events sheet:

  1. Gate the button on the Is Share Supported condition.

  2. On a trigger (e.g. Button is clicked), add the Share action and fill its Id with the id of a social.shares entry.

  3. Add the On Share Completed condition and check Is Last Action Completed Successfully.

Copy This Example

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

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

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

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

Platform support · 5 of 25 platforms

Supports: discord, facebook, msn, reddit, vk

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

On Reddit the share is posted as a comment under the post the game runs in, so the social.shares entry needs a text there.

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 and call the method without options:

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

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

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

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.

Copy This Example

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.

Copy This Example

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

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

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

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

Platform support · 4 of 25 platforms

Supports: facebook, ok, reddit, vk

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

Invite Friends

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

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

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

In the event sheet:

  1. Gate the button on the Is Invite Friends Supported condition.

  2. On a trigger (e.g. Button → On clicked), add the Invite Friends action and fill its ID with the id of a social.invites entry.

  3. Add the On Invite Friends Completed condition and check Is Last Action Completed Successfully.

Copy This Example

In the events sheet:

  1. Gate the button on the Is Invite Friends Supported condition.

  2. On a trigger (e.g. Button is clicked), add the Invite Friends action and fill its Id with the id of a social.invites entry.

  3. Add the On Invite Friends Completed condition and check Is Last Action Completed Successfully.

Copy This Example

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

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

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

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

Platform support · 4 of 25 platforms

Supports: discord, facebook, ok, vk

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

Create Post

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

A post is created by its id, and an optional second argument travels with that one post: the game's own string, handed back as platform.payload when someone opens the game from it. That is what makes level sharing work — put the level into the payload, read it back on launch. A post created from an entry can also carry rewards.

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

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

In the event sheet:

  1. Gate the button on the Is Create Post Supported condition.

  2. On a trigger (e.g. Button → On clicked), add the Create Post action and fill its ID with the id of a social.posts entry and an optional Payload.

  3. Add the On Create Post Completed condition and check Is Last Action Completed Successfully.

Copy This Example

In the events sheet:

  1. Gate the button on the Is Create Post Supported condition.

  2. On a trigger (e.g. Button is clicked), add the Create Post action and fill its Id with the id of a social.posts entry and an optional Payload.

  3. Add the On Create Post Completed condition and check Is Last Action Completed Successfully.

Copy This Example

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

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

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

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

Platform support · 2 of 25 platforms

Supports: ok, reddit

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

Post Rewards

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

Configuration

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

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

Get Post Reward

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

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

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

Gate everything on the Is Post Reward Supported condition, call the Get Post Reward action, then handle the On Get Post Reward Completed trigger. Read the result with the PostRewardsCount, PostRewardId, PostRewardAmount, PostRewardType expressions, or take everything at once with PostRewardsAsJSON.

Copy This Example

Gate everything on the Is Post Reward Supported condition, call the Get Post Reward action, then handle the On Get Post Reward Completed condition. Read the result with the PlaygamaBridge::PostRewardsCount(), PlaygamaBridge::PostRewardId(index), PlaygamaBridge::PostRewardAmount(index), PlaygamaBridge::PostRewardType(index) expressions, or take everything at once with PlaygamaBridge::PostRewardsAsJSON().

Copy This Example

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

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

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

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

A PostReward looks like this:

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

Platform support · 1 of 25 platforms

Supports: reddit

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

Add to Favorites

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

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

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

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.

Copy This Example

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.

Copy This Example

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

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

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

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

Platform support · 2 of 25 platforms

Supports: tiktok, vk

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

Add to Home Screen

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

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

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

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.

Copy This Example

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.

Copy This Example

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

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

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

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

Platform support · 4 of 25 platforms

Supports: samsung, tiktok, vk, yandex

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

Rate Game

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

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

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

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.

Copy This Example

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.

Copy This Example

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

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

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

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

Platform support · 3 of 25 platforms

Supports: microsoft_store, ok, yandex

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

Last updated