Playgama
  • Welcome
  • πŸš€Quick start
  • Submitting a game
  • Game Requirments
    • πŸ’₯Self-check
    • Technical Requirements
    • Advertising Requirements
    • User Experience Requirements
    • Content Requirements
    • Other Requirements
    • Platform-Specific Requirements
  • In-Game Purchases
    • Step-by-step IAP integration guide for Unity
  • FAQ
    • General
    • Submitting a Game
    • Game Moderation
    • Payments and Statistics
  • SDK
    • Getting started
    • Engines
      • Core (Plain JS)
        • πŸ’₯Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Unity
        • πŸ’₯Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Construct 3
        • πŸ’₯Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • GDevelop
        • πŸ’₯Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Godot
        • πŸ’₯Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Game Maker
        • πŸ’₯Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Defold
        • πŸ’₯Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
    • Changelog
  • For Partners
    • Getting Started
    • Embed the Widget
      • Adding Games Widget to Your WordPress Site
      • Adding Games Widget to Your Tilda Site
      • Adding Games Widget to Your Framer Site
    • Import the Game Catalog
    • Share your referral link
Powered by GitBook
On this page
  1. SDK
  2. Engines
  3. Unity

Social Interactions

Enable social features to enhance player engagement by allowing them to share, join communities, invite friends, and more.

Share

Use this to allow players to share game content or achievements on social media platforms.

Bridge.social.isShareSupported

Check if the share functionality is supported on the platform.

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

Join Community

Enable players to join social communities related to your game, enhancing engagement and loyalty.

Bridge.social.isJoinCommunitySupported

Check if the join community functionality is supported on the platform.

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;
    }

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

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

Invite Friends

Allow players to invite their friends to play the game, helping to grow your player base organically.

Bridge.social.isInviteFriendsSupported

Check if the invite friends functionality is supported on the platform.

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

    switch (Bridge.platform.id)
    {
        case "ok":
            options.Add("text", "Hello World!");
            break;
    }

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

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

Create Post

Use this to let players create posts about their achievements or updates directly from the game.

Bridge.social.isCreatePostSupported

Check if the create post functionality is supported on the platform.

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

Add to Favorites

Allow players to bookmark your game for easy access in the future.

Bridge.social.isAddToFavoritesSupported

Check if the add to favorites functionality is supported on the platform.

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

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

Add to Home Screen

Enable players to add a shortcut to your game on their home screen for quick access.

Bridge.social.isAddToHomeScreenSupported

Check if the add to home screen functionality is supported on the platform.

private void Start()
{
    Bridge.social.AddToHomeScreen(OnAddToFavoritesCompleted);
}

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

Rate Game

Encourage players to rate your game, providing valuable feedback and improving visibility.

Bridge.social.isRateSupported

Check if the rate game functionality is supported on the platform.

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

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

External Links

Allow players to follow links to external websites, such as your game’s official site or related resources.

Bridge.social.isExternalLinksAllowed

Check if external links are allowed on the platform.

PreviousUser ParametersNextLeaderboards

Last updated 26 days ago