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

Check if the share feature is supported on the platform.

func _ready():
    var options

    match Bridge.platform.id:
        "vk":
            options = {
                "link": "YOUR_LINK"
            }

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

func _on_share_completed(success):
    print(success)

Join Community

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

Bridge.social.is_join_community_supported

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

func _ready():
    var options

    match Bridge.platform.id:
        "vk":
            options = {
                "groupId": YOUR_GROUP_ID
            }
        "ok":
            options = {
                "groupId": YOUR_GROUP_ID
            }

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

func _on_join_community_completed(success):
    print(success)

Invite Friends

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

Bridge.social.is_invite_friends_supported

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

func _ready():
    var options

    match Bridge.platform.id:
        "ok":
            options = {
                "text": "Hello World!"
            }

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

func _on_invite_friends_completed(success):
    print(success)

Create Post

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

Bridge.social.is_create_post_supported

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

func _ready():
    var options

    match Bridge.platform.id:
        "vk":
            options = {
                "message": "Hello world!",
                "attachments": "photo-199747461_457239629"
            }
        "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)

Add to Favorites

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

Bridge.social.is_add_to_favorites_supported

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

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

func _on_add_to_favorites_completed(success):
    print(success)

Add to Home Screen

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

Bridge.social.is_add_to_home_screen_supported

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

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)

Rate the Game

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

Bridge.social.is_rate_supported

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

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

func _on_rate_completed(success):
    print(success)

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

Bridge.social.is_external_links_allowed

Check if external links are allowed on the platform.

Last updated