diff --git a/SodaLive/Sources/App/AppDelegate.swift b/SodaLive/Sources/App/AppDelegate.swift index e04318b..c2fac8f 100644 --- a/SodaLive/Sources/App/AppDelegate.swift +++ b/SodaLive/Sources/App/AppDelegate.swift @@ -94,7 +94,7 @@ extension AppDelegate : UNUserNotificationCenterDelegate { // With swizzling disabled you must let Messaging know about the message, for Analytics Messaging.messaging().appDidReceiveMessage(userInfo) - let roomIdString = userInfo["suda_room_id"] as? String + let roomIdString = userInfo["room_id"] as? String let audioContentIdString = userInfo["audio_content_id"] as? String if let roomIdString = roomIdString, let roomId = Int(roomIdString), roomId > 0 { diff --git a/SodaLive/Sources/Live/LiveView.swift b/SodaLive/Sources/Live/LiveView.swift index cf10c74..5c9416b 100644 --- a/SodaLive/Sources/Live/LiveView.swift +++ b/SodaLive/Sources/Live/LiveView.swift @@ -155,6 +155,44 @@ struct LiveView: View { } } } + .valueChanged(value: appState.pushRoomId) { value in + DispatchQueue.main.async { + appState.setAppStep(step: .main) + + if value > 0 { + viewModel.enterRoom(roomId: value) + } + } + } + .valueChanged(value: appState.pushChannelId) { value in + DispatchQueue.main.async { + appState.setAppStep(step: .main) + + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + if value > 0 { + appState.setAppStep(step: .creatorDetail(userId: value)) + } + } + } + } + .valueChanged(value: appState.pushAudioContentId) { value in + appState.setAppStep(step: .main) + + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + if value > 0 { + appState.setAppStep(step: .contentDetail(contentId: value)) + } + } + } + .onAppear { + if appState.pushRoomId > 0 { + viewModel.enterRoom(roomId: appState.pushRoomId) + } else if appState.pushChannelId > 0 { + appState.setAppStep(step: .creatorDetail(userId: appState.pushChannelId)) + } else if appState.pushAudioContentId > 0 { + appState.setAppStep(step: .contentDetail(contentId: appState.pushAudioContentId)) + } + } } private func onCreateSuccess(response: CreateLiveRoomResponse) { diff --git a/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusView.swift b/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusView.swift index 89a4667..254464b 100644 --- a/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusView.swift +++ b/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusView.swift @@ -52,7 +52,7 @@ struct LiveReservationStatusView: View { } } .onAppear { - viewModel.getSudaReservationStatus() + viewModel.getLiveReservationStatus() } } } diff --git a/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusViewModel.swift b/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusViewModel.swift index f6a2ab1..306aff9 100644 --- a/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusViewModel.swift +++ b/SodaLive/Sources/MyPage/ReservationStatus/LiveReservationStatusViewModel.swift @@ -26,7 +26,7 @@ final class LiveReservationStatusViewModel: ObservableObject { @Published var isCancelComplete = false - func getSudaReservationStatus() { + func getLiveReservationStatus() { isLoading = true repository.getReservations(isActive: true)