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 functionality is supported on the platform.
local bridge = require("bridge.bridge")
function init(self)
local options = {
vk = {
link = "YOUR_LINK"
},
facebook = {
image = "A base64 encoded image to be shared",
text = "A text message to be shared.",
}
}
bridge.social.share(options, function ()
-- success
end, function ()
-- error
end)
end
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 functionality is supported on the platform.
local bridge = require("bridge.bridge")
function init(self)
local options = {
vk = {
groupId = "YOUR_GROUP_ID"
},
ok = {
groupId = "YOUR_GROUP_ID"
}
}
bridge.social.join_community(options, function ()
-- success
end, function ()
-- error
end)
end
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 functionality is supported on the platform.
local bridge = require("bridge.bridge")
function init(self)
local options = {
vk = {
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
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 functionality is supported on the platform.
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
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 functionality is supported on the platform.
local bridge = require("bridge.bridge")
function init(self)
bridge.social.add_to_favorites(function ()
-- success
end, function ()
-- error
end)
end
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 functionality is supported on the platform.
local bridge = require("bridge.bridge")
function init(self)
bridge.social.add_to_home_screen(function ()
-- success
end, function ()
-- error
end)
end
Rate Game
Encourage players to rate your game, providing valuable feedback and improving visibility.
bridge.social.is_rate_supported()
Check if the rate game functionality is supported on the platform.
local bridge = require("bridge.bridge")
function init(self)
bridge.social.rate(function ()
-- success
end, function ()
-- error
end)
end
External Links
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.