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',
})
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter facebook for Facebook. | Required |
app_id | string | Unique app ID of the Facebook app | Required |
href | string | Link attached to the shared post | Required |
display | string | Dialog box rendering methods: page iframe popup touch For more information, see Share Dialog. | Optional |
redirect_uri | string | Redirect URL for clicking the button in the dialog | Optional |
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: ''
})
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter kakao for Kakao. | Required |
shareType | string | Share type story: Kakao story talk: Kakao talk | Required |
jsKey | string | kakao jskey | Required |
href | string | URL of the shared page When shareType is story , set title, background image and other settings to the shared page. | |
text | string | Automatically enterted text Set to a null string when default text is not required. | Require when shareType is story |
imageUrl | string | Background image URL of the shared page | Require when shareType is talk |
title | string | Title of the shared page | Require when shareType is talk |
description | string | Description of the shared page | Optional 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',
})
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter twitter for Twitter. | Required |
url | string | Shared URL that is automatically shortened in a Tweet A Twitter Card may appear for the shared URL. | Optional |
via | string | Use the via parameter to tag users (@username) | Optional |
text | string | Preview of the text in Tweet editor Tweet author can easily delete text with a single delete action. | Optional |
hashtags | string | Use the hashtags parameter to add a comma-separated list of hashtags to Tweets | Optional |
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',
})
Parameter | Type | Description | Remark |
---|---|---|---|
third_type | string | Third-party channel Enter vk for VK. | Required |
url | string | URL of the shared content | Required |
image | string | Image URL | Optional |
title | string | Title of the shared content | Optional |