Namespace: Story

Kakao. Story

Include functions related to KakaoStory share button.

Methods


<static> cleanup()

Deactivate resource related to KakaoStory share button.


<static> createFollowButton(settings)

Follow KakaoStory Channel when specified element is clicked.

Parameters:
Name Type Description
settings Object

Attributes of KakaoStory follow button are passed by 'key/value' format.

Properties
Name Type Argument Default Description
container String | DOMElement

ID Selector or DOM Element of a container that will contain the KakaoStory follow button.

id String

KakaoStory Channel ID to follow. ex) kakao

showFollowerCount Boolean <optional>
true

Show follower count. Alternatively, data-show-follower-count attribute in 'container' element can be used instead.

type "horizontal" | "vertical" <optional>
"horizontal"

elect style for showing follower count. Alternatively, data-type attribute in 'container' element can be used instead.


<static> createShareButton(settings)

Open KakaoStory share popup when specified element is clicked.

Parameters:
Name Type Description
settings Object

Attributes of KakaoStory share button are passed by 'key/value' format.

Properties
Name Type Argument Default Description
container String | DOMElement

ID Selector or DOM Element of a container that will open the KakaoStory share popup when clicked.

url String <optional>
${current page's URL}

The URL to share in KakaoStory. Alternatively, data-url attribute in 'container' element can be used.

text String <optional>
""

Default text to display in share popup


<static> open(settings)

Open KakaoStory mobile App.

Parameters:
Name Type Description
settings Object

Attributes of KakaoStory share button are passed by 'key/value' format.

Properties
Name Type Argument Default Description
url String <optional>
${current page's URL}

The web page URL to share in KakaoStory

text String <optional>
""

Default text to display in share popup

urlInfo Obejct <optional>
${created by scrap server}

Additional info of the shared web page

Properties
Name Type Argument Description
title String

Title of shared web page

desc String <optional>

Description of shared web page

name String <optional>

Display name of shared web page

imageUrl String <optional>

An Image url which represent shared web page

Examples
// 1. Use only the required options; other data will be generated by the scrap server
Kakao.Story.open({
  url: 'http://my.share.url.com',
  text: 'Text to share',
});
// 2. When you want to change the meta-information of the scrapped url
Kakao.Story.open({
  url: 'http://my.share.url.com',
  text: 'Text to share',
  urlInfo: {
    title: 'The title of a shared site',
    desc: 'A description of a website',
    name: 'The name at the bottom',
    images: ['http://my.image.url']
  }
});

<static> share(settings)

Open KakaoStory share popup.

Parameters:
Name Type Description
settings Object

Attributes of KakaoStory share button are passed by 'key/value' format.

Properties
Name Type Argument Default Description
url String <optional>
${current page's URL}

The URL to share in KakaoStory

text"" String <optional>

Default text to display in share popup