LocationTemplate

public struct LocationTemplate : Codable, Templatable

주소를 이용하여 특정 위치를 공유할 수 있는 메시지 템플릿 입니다.

위치 템플릿은 지도 표시에 사용되는 주소 정보와 해당 위치를 설명할 수 있는 컨텐츠 오브젝트로 구성됩니다. 왼쪽 하단에 기본 버튼, 오른쪽 하단에 지도를 보여주기 위한 위치 보기 버튼이 추가됩니다. 위치 보기 버튼을 클릭하면 카카오톡 채팅방 내에서 바로 지도 화면으로 전환하여 해당 주소의 위치를 확인할 수 있습니다.

let template = LocationTemplate(address: "경기 성남시 분당구 판교역로 235 에이치스퀘어 N동 8층",
                                addressTitle: "카카오 판교오피스 카페톡",
                                content: Content(title: "신메뉴 출시❤️ 체리블라썸라떼",
                                                 imageUrl: URL(string: "http://mud-kage.kakao.co.kr/dn/bSbH9w/btqgegaEDfW/vD9KKV0hEintg6bZT4v4WK/kakaolink40_original.png")!,
                                                 description: "이번 주는 체리블라썸라떼 1+1",
                                                 link: Link(mobileWebUrl: URL(string: "https://developers.kakao.com")!)),
                                buttonTitle: "메뉴 보기")
  • location 고정 값

    Declaration

    Swift

    public let objectType: String
  • 공유할 위치의 주소. 예) 경기 성남시 분당구 판교역로 235

    Declaration

    Swift

    public let address: String
  • 카카오톡 내의 지도 뷰에서 사용되는 타이틀. 예) 카카오판교오피스

    Declaration

    Swift

    public let addressTitle: String?
  • 위치에 대해 설명하는 컨텐츠 정보

    Seealso

    Content

    Declaration

    Swift

    public let content: Content
  • 댓글수, 좋아요수 등, 컨텐츠에 대한 소셜 정보

    Seealso

    Social

    Declaration

    Swift

    public let social: Social?
  • 기본 버튼 타이틀(자세히 보기)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content에 입력된 값이 사용됩니다.

    Declaration

    Swift

    public let buttonTitle: String?
  • 버튼 목록. 기본 버튼의 타이틀 외에 링크도 변경하고 싶을 때 설정 합니다. (최대 1개, 오른쪽 위치 보기 버튼은 고정)

    Seealso

    Button

    Declaration

    Swift

    public let buttons: [Button]?
  • Declaration

    Swift

    public func toJsonObject() -> [String : Any]?