@@ -6,6 +6,7 @@ import BKDesign
66import Combine
77import Foundation
88import UIKit
9+ import UserNotifications
910
1011public final class AppCoordinator : Coordinator , AuthenticationRequiredNotifying , ScreenLoggable {
1112 public var screenName : String = GATracking . OnboardingAndAuth. splash
@@ -120,9 +121,10 @@ public final class AppCoordinator: Coordinator, AuthenticationRequiredNotifying,
120121
121122 loginCoordinator. onFinish = { [ weak self] in
122123 guard let self else { return }
123-
124+
124125 self . navigationController. dismiss ( animated: animated)
125126 AccessModeCenter . shared. mode. send ( . member)
127+ self . requestNotificationPermissionIfNeeded ( )
126128 self . checkAuthAndRoute ( )
127129 onFinishAuth ? ( )
128130 }
@@ -210,11 +212,25 @@ public final class AppCoordinator: Coordinator, AuthenticationRequiredNotifying,
210212 leftButtonAction: AppStoreLinker . openAppStore
211213 )
212214 )
213-
215+
214216 let dialogViewController = BKDialogViewController ( dialog: dialog)
215217 dialogViewController. isModalInPresentation = true
216218 DispatchQueue . main. async {
217219 self . navigationController. present ( dialogViewController, animated: true )
218220 }
219221 }
222+
223+ private func requestNotificationPermissionIfNeeded( ) {
224+ UNUserNotificationCenter . current ( ) . getNotificationSettings { settings in
225+ // 아직 권한을 요청하지 않았을 때만 요청
226+ guard settings. authorizationStatus == . notDetermined else { return }
227+
228+ UNUserNotificationCenter . current ( ) . requestAuthorization ( options: [ . alert, . badge, . sound] ) { granted, _ in
229+ guard granted else { return }
230+ DispatchQueue . main. async {
231+ UIApplication . shared. registerForRemoteNotifications ( )
232+ }
233+ }
234+ }
235+ }
220236}
0 commit comments