Skip to main content

Share Message with Text Template

Text Template​

Official Documentation

This message format contains only text.

Use Case: Send detailed information in a long message or create a simple text-only message.

Image

Template Type Definition​

/**
* Basic template class for text-based messages.
*
* @property text Text to include in the message (up to 200 characters)
* @property link Link information for moving when the content is clicked
* @property buttons Button list. Used when you want to change the button title and the link, or when you want to use two buttons. (Up to 2 buttons)
* @property buttonTitle Set to change the default button title "Learn more". If used, the link to move when the button is clicked will be the value entered in the content
*/
export interface KakaoTextTemplate {
text: string;
link: KakaoTemplateLink;
buttons?: KakaoTemplateButton[];
buttonTitle?: string;
}

Usage​

Use shareTextTemplate to share a template message.

export function shareTextTemplate(params: {
template: KakaoTextTemplate;
useWebBrowserIfKakaoTalkNotAvailable?: boolean;
serverCallbackArgs?: Record<string, string>;
pickerSettings?: KakaoSharePickerSettings;
})
  • template: The template object.

  • useWebBrowserIfKakaoTalkNotAvailable: Specifies whether to use a web browser for sharing when KakaoTalk is not available. The default value is true.

  • serverCallbackArgs: Server callback arguments. Each value must be passed as a string.

  • pickerSettings: Share target selection settings.

info

Refer to Component Types for detailed component types.

If you encounter any issues, refer to Troubleshooting.