From 250f169b42943830b533b8a1dc61caa5074ce9f0 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Thu, 2 May 2024 15:20:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20-=20=EA=B3=B5?= =?UTF-8?q?=EC=9C=A0=ED=95=98=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Live/Room/LiveRoomViewModel.swift | 44 ------------------- .../View/LiveRoomInfoGuestView.swift | 9 ---- .../Component/View/LiveRoomInfoHostView.swift | 9 ---- .../Sources/Live/Room/V2/LiveRoomViewV2.swift | 6 --- 4 files changed, 68 deletions(-) diff --git a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift index 3b4a972..9d06313 100644 --- a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift +++ b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift @@ -814,50 +814,6 @@ final class LiveRoomViewModel: NSObject, ObservableObject { .store(in: &subscription) } - func shareRoom() { - guard let link = URL(string: "https://sodalive.net/?room_id=\(AppState.shared.roomId)") else { return } - let dynamicLinksDomainURIPrefix = "https://sodalive.page.link" - guard let linkBuilder = DynamicLinkComponents(link: link, domainURIPrefix: dynamicLinksDomainURIPrefix) else { - self.errorMessage = "공유링크를 생성하지 못했습니다.\n다시 시도해 주세요." - self.isShowErrorPopup = true - return - } - - linkBuilder.iOSParameters = DynamicLinkIOSParameters(bundleID: "kr.co.vividnext.sodalive") - linkBuilder.iOSParameters?.appStoreID = "6461721697" - - linkBuilder.androidParameters = DynamicLinkAndroidParameters(packageName: "kr.co.vividnext.sodalive") - - guard let longDynamicLink = linkBuilder.url else { - self.errorMessage = "공유링크를 생성하지 못했습니다.\n다시 시도해 주세요." - self.isShowErrorPopup = true - return - } - DEBUG_LOG("The long URL is: \(longDynamicLink)") - - DynamicLinkComponents.shortenURL(longDynamicLink, options: nil) { [unowned self] url, warnings, error in - let shortUrl = url?.absoluteString - - if let liveRoomInfo = self.liveRoomInfo { - let urlString = shortUrl != nil ? shortUrl! : longDynamicLink.absoluteString - if liveRoomInfo.isPrivateRoom { - shareMessage = "\(UserDefaults.string(forKey: .nickname))님이 귀하를 소다라이브 비공개라이브에 초대하였습니다.\n" + - "※ 라이브 참여: \(urlString)\n" + - "(입장 비밀번호: \(liveRoomInfo.password!))" - } else { - shareMessage = "\(UserDefaults.string(forKey: .nickname))님이 귀하를 소다라이브 공개라이브에 초대하였습니다.\n" + - "※ 라이브 참여: \(urlString)" - } - - isShowShareView = true - } else { - self.errorMessage = "공유링크를 생성하지 못했습니다.\n다시 시도해 주세요." - self.isShowErrorPopup = true - return - } - } - } - func kickOut() { repository.kickOut(roomId: AppState.shared.roomId, userId: kickOutId) .sink { result in diff --git a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift index 92d4a0a..ed5537e 100644 --- a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift +++ b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoGuestView.swift @@ -30,7 +30,6 @@ struct LiveRoomInfoGuestView: View { let onClickQuit: () -> Void let onClickToggleBg: () -> Void - let onClickShare: () -> Void let onClickFollow: (Bool) -> Void let onClickProfile: (Int) -> Void let onClickNotice: () -> Void @@ -86,13 +85,6 @@ struct LiveRoomInfoGuestView: View { strokeWidth: 1, strokeCornerRadius: 5.3 ) { onClickToggleBg() } - - LiveRoomOverlayStrokeImageButton( - imageName: "ic_share", - strokeColor: Color.graybb, - strokeWidth: 1, - strokeCornerRadius: 5.3 - ) { onClickShare() } } HStack(spacing: 8) { @@ -226,7 +218,6 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider { isAdult: false, onClickQuit: {}, onClickToggleBg: {}, - onClickShare: {}, onClickFollow: { _ in }, onClickProfile: { _ in }, onClickNotice: {}, diff --git a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift index c16e5d1..a17b80f 100644 --- a/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift +++ b/SodaLive/Sources/Live/Room/V2/Component/View/LiveRoomInfoHostView.swift @@ -31,7 +31,6 @@ struct LiveRoomInfoHostView: View { let onClickQuit: () -> Void let onClickToggleBg: () -> Void - let onClickShare: () -> Void let onClickEdit: () -> Void let onClickProfile: (Int) -> Void let onClickNotice: () -> Void @@ -78,13 +77,6 @@ struct LiveRoomInfoHostView: View { strokeCornerRadius: 5.3 ) { onClickToggleBg() } - LiveRoomOverlayStrokeImageButton( - imageName: "ic_share", - strokeColor: Color.graybb, - strokeWidth: 1, - strokeCornerRadius: 5.3 - ) { onClickShare() } - LiveRoomOverlayStrokeImageButton( imageName: "ic_edit", strokeColor: Color.graybb, @@ -241,7 +233,6 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider { isAdult: false, onClickQuit: {}, onClickToggleBg: {}, - onClickShare: {}, onClickEdit: {}, onClickProfile: { _ in }, onClickNotice: {}, diff --git a/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift b/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift index 567d2e6..e94c983 100644 --- a/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift +++ b/SodaLive/Sources/Live/Room/V2/LiveRoomViewV2.swift @@ -45,9 +45,6 @@ struct LiveRoomViewV2: View { onClickToggleBg: { viewModel.isBgOn.toggle() }, - onClickShare: { - viewModel.shareRoom() - }, onClickEdit: { viewModel.isShowEditRoomInfoDialog = true }, @@ -95,9 +92,6 @@ struct LiveRoomViewV2: View { onClickToggleBg: { viewModel.isBgOn.toggle() }, - onClickShare: { - viewModel.shareRoom() - }, onClickFollow: { if $0 { viewModel.creatorUnFollow()