From 4a0ccfa075bee70810c7d5ac688ba028443ec488 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Fri, 7 Mar 2025 01:30:39 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C,=20=EC=BD=98?= =?UTF-8?q?=ED=85=90=EC=B8=A0,=20=EC=B1=84=EB=84=90=20=EA=B3=B5=EC=9C=A0?= =?UTF-8?q?=20=EC=9E=AC=EC=B6=94=EA=B0=80=20-=20AppsFlyer=20OneLink?= =?UTF-8?q?=EB=A1=9C=20=EA=B3=B5=EC=9C=A0=EB=A7=81=ED=81=AC=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Detail/ContentDetailViewModel.swift | 13 +++++++++ .../Explorer/Profile/UserProfileView.swift | 6 +++- .../Profile/UserProfileViewModel.swift | 12 +++++++- .../Sources/Live/Room/LiveRoomViewModel.swift | 29 ++++++++++++++++++- 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/SodaLive/Sources/Content/Detail/ContentDetailViewModel.swift b/SodaLive/Sources/Content/Detail/ContentDetailViewModel.swift index 55cb67c..baedb5e 100644 --- a/SodaLive/Sources/Content/Detail/ContentDetailViewModel.swift +++ b/SodaLive/Sources/Content/Detail/ContentDetailViewModel.swift @@ -200,6 +200,19 @@ final class ContentDetailViewModel: ObservableObject { } func shareAudioContent(contentImage: String, contentTitle: String) { + isLoading = true + + let shareUrl = "https://voiceon.onelink.me/RkTm?" + + "af_dp=voiceon://" + + "&deep_link_value=content" + + "&deep_link_sub5=\(contentId)" + + "&af_og_title=\(contentTitle)" + + "&af_og_description=지금 보이스온에서 이 콘텐츠 감상하기" + + "&af_og_image=\(contentImage)" + + self.isLoading = false + self.shareMessage = shareUrl + self.isShowShareView = true } func registerComment(comment: String, isSecret: Bool) { diff --git a/SodaLive/Sources/Explorer/Profile/UserProfileView.swift b/SodaLive/Sources/Explorer/Profile/UserProfileView.swift index 8e383cb..0b0f84d 100644 --- a/SodaLive/Sources/Explorer/Profile/UserProfileView.swift +++ b/SodaLive/Sources/Explorer/Profile/UserProfileView.swift @@ -57,7 +57,11 @@ struct UserProfileView: View { } showCreatorFollowNotifyDialog: { isShowFollowNotifyDialog = true } shareChannel: { - viewModel.shareChannel(userId: userId) + viewModel.shareChannel( + userId: creatorProfile.creator.creatorId, + nickname: creatorProfile.creator.nickname, + profileImage: creatorProfile.creator.profileUrl + ) } if creatorProfile.isCreatorRole { diff --git a/SodaLive/Sources/Explorer/Profile/UserProfileViewModel.swift b/SodaLive/Sources/Explorer/Profile/UserProfileViewModel.swift index e5b6e9c..0f2a93b 100644 --- a/SodaLive/Sources/Explorer/Profile/UserProfileViewModel.swift +++ b/SodaLive/Sources/Explorer/Profile/UserProfileViewModel.swift @@ -398,7 +398,17 @@ final class UserProfileViewModel: ObservableObject { .store(in: &subscription) } - func shareChannel(userId: Int) { + func shareChannel(userId: Int, nickname: String, profileImage: String) { + let shareUrl = "https://voiceon.onelink.me/RkTm?" + + "af_dp=voiceon://" + + "&deep_link_value=channel" + + "&deep_link_sub5=\(userId)" + + "&af_og_title=보이스온" + + "&af_og_description=보이스온 \(nickname)님의 채널입니다." + + "&af_og_image=\(profileImage)" + + self.shareMessage = "보이스온 \(nickname)님의 채널입니다.\n\(shareUrl)" + self.isShowShareView = true } func userBlock(userId: Int) { diff --git a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift index e4b4888..91e9c64 100644 --- a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift +++ b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift @@ -923,7 +923,34 @@ final class LiveRoomViewModel: NSObject, ObservableObject { .store(in: &subscription) } - func shareRoom() { + func shareRoom() { + if let liveRoomInfo = self.liveRoomInfo { + var shareUrl = "https://voiceon.onelink.me/RkTm?" + + "af_dp=voiceon://" + + "&deep_link_value=live" + + "&deep_link_sub5=\(AppState.shared.roomId)" + + "&af_og_title=보이스온" + + "&af_og_description=지금 보이스온에서 라이브 참여하기" + + if let coverImageUrl = coverImageUrl { + shareUrl = shareUrl + "&af_og_image=\(coverImageUrl)" + } + + if liveRoomInfo.isPrivateRoom { + shareMessage = "\(UserDefaults.string(forKey: .nickname))님이 귀하를 보이스온 비공개라이브에 초대하였습니다.\n" + + "※ 라이브 참여: \(shareUrl)\n" + + "(입장 비밀번호: \(liveRoomInfo.password!))" + } else { + shareMessage = "\(UserDefaults.string(forKey: .nickname))님이 귀하를 보이스온 공개라이브에 초대하였습니다.\n" + + "※ 라이브 참여: \(shareUrl)" + } + + isShowShareView = true + } else { + self.errorMessage = "공유링크를 생성하지 못했습니다.\n다시 시도해 주세요." + self.isShowErrorPopup = true + return + } } func kickOut() {