diff --git a/src/app/(Sub)/detail/[id]/DetailSection.tsx b/src/app/(Sub)/detail/[id]/DetailSection.tsx index 448038f..e2c3840 100644 --- a/src/app/(Sub)/detail/[id]/DetailSection.tsx +++ b/src/app/(Sub)/detail/[id]/DetailSection.tsx @@ -57,7 +57,7 @@ export default function DetailSection({ poseId }: DetailSectionProps) { type="secondary" className="border border-border-default" /> - shareKakao(BASE_SITE_URL + pathname)} /> + shareKakao(poseId)} /> ); diff --git a/src/hooks/useKakaoShare.ts b/src/hooks/useKakaoShare.ts index 9888194..64969e1 100644 --- a/src/hooks/useKakaoShare.ts +++ b/src/hooks/useKakaoShare.ts @@ -3,7 +3,6 @@ import { useEffect } from 'react'; import { KAKAO_JS_KEY } from '@/constants/env'; -import { OPEN_GRAPH } from '@/constants/meta'; export default function useKakaoShare() { useEffect(() => { @@ -16,31 +15,18 @@ export default function useKakaoShare() { }; }, []); - const shareKakao = (uri: string) => { + const shareKakao = (poseId: number) => { if (window.Kakao) { const kakao = window.Kakao; if (!kakao.isInitialized()) { kakao.init(KAKAO_JS_KEY); } - kakao.Link.sendDefault({ - objectType: 'feed', - content: { - ...OPEN_GRAPH.kakao_share, - link: { - mobileWebUrl: uri, - webUrl: uri, - }, + kakao.Share.sendCustom({ + templateId: 108921, + templateArgs: { + poseId, }, - buttons: [ - { - title: '포즈 확인하기', - link: { - mobileWebUrl: uri, - webUrl: uri, - }, - }, - ], }); } };