fix: 네이티브 공유 시 설명 텍스트 제거
This commit is contained in:
parent
17319e950e
commit
8be95778f3
@ -41,14 +41,12 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
|
||||
|
||||
const shareUrl = buildContentShareUrl(API_URL, videoId, contentType);
|
||||
const shareTitle = title || storeName || t('videoDetail.kakaoDefaultTitle');
|
||||
const shareDescription = description || t('videoDetail.kakaoDescription', { region: region ?? '' });
|
||||
|
||||
const handleShareBtnClick = async (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
|
||||
const handled = await tryNativeShare({
|
||||
title: shareTitle,
|
||||
text: shareDescription,
|
||||
url: shareUrl,
|
||||
});
|
||||
if (handled) {
|
||||
|
||||
@ -104,7 +104,6 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
|
||||
const shareUrl = buildVideoShareUrl(API_URL, videoId);
|
||||
const shareTitle = video?.title || video?.store_name || t('videoDetail.kakaoDefaultTitle');
|
||||
const shareDescription = video?.description || t('videoDetail.kakaoDescription', { region: video?.region ?? '' });
|
||||
|
||||
const handleCopyLink = async () => {
|
||||
try {
|
||||
@ -119,7 +118,6 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
|
||||
const handleShareButtonClick = async () => {
|
||||
const handled = await tryNativeShare({
|
||||
title: shareTitle,
|
||||
text: shareDescription,
|
||||
url: shareUrl,
|
||||
});
|
||||
if (handled) {
|
||||
|
||||
@ -143,7 +143,6 @@ const SsulDetailContent: React.FC<SsulDetailContentProps> = ({
|
||||
const handleShareButtonClick = async () => {
|
||||
const handled = await tryNativeShare({
|
||||
title: content?.store_name ?? t('videoDetail.kakaoDefaultTitle'),
|
||||
text: t('videoDetail.kakaoDescription', { region: content?.region ?? '' }),
|
||||
url: shareUrl,
|
||||
});
|
||||
if (handled) {
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
/**
|
||||
* 기기의 네이티브 공유 시트를 열고 요청을 처리했는지 반환합니다.
|
||||
*
|
||||
* 긴 `text`를 넣으면 카카오 등이 URL을 미리보기가 아니라 본문 텍스트로만 보냅니다.
|
||||
* 제목·설명은 OG 페이지(`og:title`, `og:description`)에 두고, 여기에는 url(과 짧은 title)만 넘깁니다.
|
||||
*
|
||||
* 사용자가 공유 시트를 닫은 경우도 정상적으로 처리된 것으로 간주합니다.
|
||||
*/
|
||||
export async function tryNativeShare(data: ShareData): Promise<boolean> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user