feat: 포그라운드 상태에서 FCM data-only 수신 시 인앱 팝업 표시
This commit is contained in:
@@ -10,6 +10,9 @@ import SwiftUI
|
||||
struct ContentView: View {
|
||||
@StateObject private var appState = AppState.shared
|
||||
|
||||
@State private var isShowDialog = false
|
||||
@State private var message = ""
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
Color.black.ignoresSafeArea()
|
||||
@@ -199,7 +202,7 @@ struct ContentView: View {
|
||||
|
||||
case .tempCanPayment(let orderType, let contentId, let title, let can):
|
||||
CanPaymentTempView(orderType: orderType, contentId: contentId, title: title, can: can)
|
||||
|
||||
|
||||
case .blockList:
|
||||
BlockMemberListView()
|
||||
|
||||
@@ -243,6 +246,23 @@ struct ContentView: View {
|
||||
EmptyView()
|
||||
.frame(width: 0, height: 0, alignment: .topLeading)
|
||||
}
|
||||
|
||||
if isShowDialog {
|
||||
SodaDialog(
|
||||
title: "포인트 지급",
|
||||
desc: message,
|
||||
confirmButtonTitle: "확인"
|
||||
) {
|
||||
isShowDialog = false
|
||||
message = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: .pointGranted)) {
|
||||
if let msg = $0.object as? String {
|
||||
self.message = msg
|
||||
self.isShowDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user