푸시 혹은 공유링크를 타고 앱을 실행했을 때 처리되는 로직 수정
This commit is contained in:
parent
8e23f65086
commit
5a771f14bd
|
@ -94,7 +94,7 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
|
||||||
// With swizzling disabled you must let Messaging know about the message, for Analytics
|
// With swizzling disabled you must let Messaging know about the message, for Analytics
|
||||||
Messaging.messaging().appDidReceiveMessage(userInfo)
|
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
|
let audioContentIdString = userInfo["audio_content_id"] as? String
|
||||||
|
|
||||||
if let roomIdString = roomIdString, let roomId = Int(roomIdString), roomId > 0 {
|
if let roomIdString = roomIdString, let roomId = Int(roomIdString), roomId > 0 {
|
||||||
|
|
|
@ -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) {
|
private func onCreateSuccess(response: CreateLiveRoomResponse) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct LiveReservationStatusView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
viewModel.getSudaReservationStatus()
|
viewModel.getLiveReservationStatus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ final class LiveReservationStatusViewModel: ObservableObject {
|
||||||
|
|
||||||
@Published var isCancelComplete = false
|
@Published var isCancelComplete = false
|
||||||
|
|
||||||
func getSudaReservationStatus() {
|
func getLiveReservationStatus() {
|
||||||
isLoading = true
|
isLoading = true
|
||||||
|
|
||||||
repository.getReservations(isActive: true)
|
repository.getReservations(isActive: true)
|
||||||
|
|
Loading…
Reference in New Issue