Send Message with Location Template
Location Template
This message format includes location information. When the sender includes address information in a message, the recipient can click on the location information button in the message to view detailed location information on KakaoMap.
Use Case: It is useful for introducing the opening news of a new store or menu along with location information.
Template Type Definition
/**
* Message template that allows sharing a specific location using an address.
*
* @property address Address of the location to share. Example) 235 Pangyo Station-ro, Bundang-gu, Seongnam-si, Gyeonggi-do
* @property addressTitle Title used in the map view within KakaoTalk. Example) Kakao Pangyo Office
* @property content Content information describing the location
* @property social Social information about the content, such as the number of comments and likes
* @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 1 button, the view button on the right position is fixed)
* @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 KakaoLocationTemplate {
address: string;
content: KakaoTemplateContent;
addressTitle?: string;
social?: KakaoTemplateSocial;
buttons?: KakaoTemplateButton[];
buttonTitle?: string;
}
Send Message to Myself
sendLocationTemplateToMe
to send a template message to yourself.
export function sendLocationTemplateToMe(params: {
template: KakaoLocationTemplate;
})
template
: The template object.
Send Message to Friends
Use sendLocationTemplateToFriends
to send a template message to your friends.
export function sendLocationTemplateToFriends(params: {
template: KakaoLocationTemplate;
receiverUuids: string[];
})
template
: The template object.receiverUuids
: List of uuids of friends to whom the message will be sent. You can obtain this from the social package's Select KakaoTalk Friends or Get KakaoTalk Friends.
info
Refer to Component Types for detailed component types.
If you encounter any issues, refer to Troubleshooting.