Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- vue mixin
- KDT 프로그래머스 데브코스 프론트엔드
- Spacer
- react next
- 고양이 사진 검색기
- 프로그래머스 프론트엔드 데브코스
- Vue
- postcss
- vuex map
- netlify redirect
- intersection opserver
- 리액트
- 프로그래머스 데브코스
- vue 지역 컴포넌트
- 폼 입력 바인딩
- 쌓임맥락
- 이벤트 수식어
- SCSS forward
- git 같은계정 다른 컴퓨터
- KDT 프로그래머스
- flex
- 다른컴퓨터에서 git사용
- nextjs사용법
- 프로그래머스 K_Digital Training
- SCSS import
- 프로그래머스 데브코스 프론트엔드
- vue 이벤트 수신
- 리스트 렌더링
- SCSS use
- SCSS extend
Archives
- Today
- Total
혼자 적어보는 노트
Web에서 카카오톡 공유 버튼 구현 본문
Kakao Developers
카카오 API를 활용하여 다양한 어플리케이션을 개발해보세요. 카카오 로그인, 메시지 보내기, 친구 API, 인공지능 API 등을 제공합니다.
developers.kakao.com
로그인 후 내 애플리케이션 이동
애플리케이션 추가 버튼 클릭 후
앱이름/사업자명 작성 후 저장합니다.
생성된 애플리케이션을 클릭후
왼쪽 메뉴의 [플랫폼]을 클릭하여 Web 플랫폼을 등록해줍니다.
상단메뉴 문서 - 메세지 클릭 시
메시지 API에 대한 문서를 읽을 수 있습니다.
https://developers.kakao.com/docs/latest/ko/getting-started/sdk-js
Kakao Developers
카카오 API를 활용하여 다양한 어플리케이션을 개발해보세요. 카카오 로그인, 메시지 보내기, 친구 API, 인공지능 API 등을 제공합니다.
developers.kakao.com
해당링크 참고하여 초기화 진행
<script src="https://developers.kakao.com/sdk/js/kakao.js"></script>
<script>
Kakao.init('JAVASCRIPT_KEY');
console.log(Kakao.isInitialized());
</script>
'JAVASCRIPT_KEY'란에
아까 만든 내 애플리케이션의 javascript 키를 넣습니다.
function sendLink() {
Kakao.Link.sendDefault({
objectType: 'feed',
content: {
title: '딸기 치즈 케익',
description: '#케익 #딸기 #삼평동 #카페 #분위기 #소개팅',
imageUrl:
'http://k.kakaocdn.net/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png',
link: {
mobileWebUrl: 'https://developers.kakao.com',
webUrl: 'https://developers.kakao.com',
},
},
social: {
likeCount: 286,
commentCount: 45,
sharedCount: 845,
},
buttons: [
{
title: '웹으로 보기',
link: {
mobileWebUrl: 'https://developers.kakao.com',
webUrl: 'https://developers.kakao.com',
},
},
{
title: '앱으로 보기',
link: {
mobileWebUrl: 'https://developers.kakao.com',
webUrl: 'https://developers.kakao.com',
},
},
],
})
}
JS SDK 데모를 확인하여 위와 같은 코드를 넣어주고,
title, description, url등 원하는 것으로 설정합니다.
<button onclick="js:sendLink()">공유하기</button>
직접만든 버튼으로 연결할 것이기 때문에
버튼은 이렇게 활성화 할 수 있게 설정해줍니다.
'기타' 카테고리의 다른 글
터미널 기본 명령어 - windows / mac OS (0) | 2021.12.19 |
---|---|
git 바로 직전 커밋 삭제 / git reset asks more? (0) | 2021.12.16 |
[VScode] Prettier 적용 방법 / 적용 안될 때 (0) | 2021.11.25 |
정렬 알고리즘 (삽입/선택/버블) / javascript (0) | 2021.11.09 |
[Node.js] export / export default / import (0) | 2021.11.05 |
Comments