Skip to main content

Sharing on Web

Integrate the selected third-party channels that games choose to use for supporting their social features, and then follow the instructions in Share to implement the sharing feature.

Implement the sharing feature

Follow the instructions for each channel to implement the sharing feature.

Facebook

Call the share function with following data structure, where third_type is facebook.

accountApi.share({
third_type: 'facebook',
href: '',
hashtag: '#facebook share demo',
app_id: 'xxxxx',
display: 'popup',
})
ParameterTypeDescriptionRemark
third_typestringThird-party channel
Enter facebook for Facebook.
Required
app_idstringUnique app ID of the Facebook appRequired
hrefstringLink attached to the shared postRequired
displaystringDialog box rendering methods:
page
iframe
popup
touch
For more information, see Share Dialog.
Optional
redirect_uristringRedirect URL for clicking the button in the dialogOptional

Kakao

Call the share function with following data structure, where third_type is kakao.

accountApi.share({
third_type: 'kakao',

shareType: '',
jsKey: '',
href: '',
text: '',
imageUrl: '',
title: '',
description: ''
})
ParameterTypeDescriptionRemark
third_typestringThird-party channel
Enter kakao for Kakao.
Required
shareTypestringShare type
story: Kakao story
talk: Kakao talk
Required
jsKeystringkakao jskeyRequired
hrefstringURL of the shared page
When shareType is story, set title, background image and other settings to the shared page.
textstringAutomatically enterted text
Set to a null string when default text is not required.
Require when shareType is story
imageUrlstringBackground image URL of the shared pageRequire when shareType is talk
titlestringTitle of the shared pageRequire when shareType is talk
descriptionstringDescription of the shared pageOptional but pay attention when shareType is talk

Twitter

Call the share function with following data structure, where third_type is twitter.

accountApi.share({
third_type: 'twitter',

url: '',
text: '',
hashtag: '#twitter share demo',
})
ParameterTypeDescriptionRemark
third_typestringThird-party channel
Enter twitter for Twitter.
Required
urlstringShared URL that is automatically shortened in a Tweet
A Twitter Card may appear for the shared URL.
Optional
viastringUse the via parameter to tag users (@username)Optional
textstringPreview of the text in Tweet editor
Tweet author can easily delete text with a single delete action.
Optional
hashtagsstringUse the hashtags parameter to add a comma-separated list of hashtags to TweetsOptional

VK

Call the share function with following data structure, where third_type is vk.

accountApi.share({
third_type: 'vk',

url: '',
image: '',
title: 'vk share demo',
})
ParameterTypeDescriptionRemark
third_typestringThird-party channel
Enter vk for VK.
Required
urlstringURL of the shared contentRequired
imagestringImage URLOptional
titlestringTitle of the shared contentOptional