fix(notification): 푸시 딥링크 우선 실행 분기를 보정한다
This commit is contained in:
@@ -44,6 +44,7 @@ enum AppDeepLinkHandler {
|
||||
switch action {
|
||||
case .live(let roomId):
|
||||
guard roomId > 0 else { return }
|
||||
AppState.shared.isPushRoomFromDeepLink = true
|
||||
AppState.shared.pushRoomId = 0
|
||||
AppState.shared.pushRoomId = roomId
|
||||
|
||||
|
||||
@@ -265,6 +265,15 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
|
||||
// With swizzling disabled you must let Messaging know about the message, for Analytics
|
||||
Messaging.messaging().appDidReceiveMessage(userInfo)
|
||||
Notifly.userNotificationCenter(center, didReceive: response)
|
||||
|
||||
let deepLinkString = (userInfo["deep_link"] as? String ?? "")
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
|
||||
if !deepLinkString.isEmpty {
|
||||
_ = AppDeepLinkHandler.handle(urlString: deepLinkString)
|
||||
completionHandler()
|
||||
return
|
||||
}
|
||||
|
||||
let roomIdString = userInfo["room_id"] as? String
|
||||
let contentIdString = userInfo["content_id"] as? String
|
||||
|
||||
@@ -50,6 +50,7 @@ class AppState: ObservableObject {
|
||||
@Published var pushAudioContentId = 0
|
||||
@Published var pushSeriesId = 0
|
||||
@Published var pendingDeepLinkAction: AppDeepLinkAction? = nil
|
||||
@Published var isPushRoomFromDeepLink = false
|
||||
@Published var roomId = 0 {
|
||||
didSet {
|
||||
if roomId <= 0 {
|
||||
|
||||
@@ -319,17 +319,22 @@ struct HomeView: View {
|
||||
}
|
||||
|
||||
let roomId = value
|
||||
let isPushRoomFromDeepLink = appState.isPushRoomFromDeepLink
|
||||
appState.pushRoomId = 0
|
||||
appState.isPushRoomFromDeepLink = false
|
||||
|
||||
DispatchQueue.main.async {
|
||||
handleExternalNavigationRequest(
|
||||
value: roomId,
|
||||
navigationAction: {
|
||||
appState.setAppStep(step: .main)
|
||||
if !isPushRoomFromDeepLink {
|
||||
appState.setAppStep(step: .main)
|
||||
}
|
||||
liveViewModel.enterLiveRoom(roomId: roomId)
|
||||
},
|
||||
cancelAction: {
|
||||
appState.pushRoomId = 0
|
||||
appState.isPushRoomFromDeepLink = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user