Skip to content

Commit 55fc989

Browse files
committed
feat: 푸시 오픈 분석 연결
1 parent 29cf7c7 commit 55fc989

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

Application/DevLogApp/Sources/App/Assembler/AppLayerAssembler.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,10 @@ final class AppLayerAssembler: Assembler {
3131
userService: container.resolve(UserService.self)
3232
)
3333
}
34+
container.register(PushNotificationOpenHandler.self) {
35+
PushNotificationOpenHandler(
36+
trackAnalyticsEventUseCase: container.resolve(TrackAnalyticsEventUseCase.self)
37+
)
38+
}
3439
}
3540
}

Application/DevLogApp/Sources/App/Delegate/AppDelegate.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5252

5353
// 앱이 완전 종료되어도, 알림을 통해 앱이 시작된 경우 처리
5454
if let remoteNotification = launchOptions?[.remoteNotification] as? [AnyHashable: Any] {
55+
let handler = container.resolve(PushNotificationOpenHandler.self)
5556
Task { @MainActor in
56-
PushNotificationRoute.shared.handlePushTap(userInfo: remoteNotification)
57+
handler.handlePushOpen(userInfo: remoteNotification)
5758
}
5859
}
5960

@@ -110,8 +111,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
110111
) {
111112
logger.info("Tapped notification: \(response.notification.request.content.userInfo)")
112113
let userInfo = response.notification.request.content.userInfo
114+
let handler = container.resolve(PushNotificationOpenHandler.self)
113115
Task { @MainActor in
114-
PushNotificationRoute.shared.handlePushTap(userInfo: userInfo)
116+
handler.handlePushOpen(userInfo: userInfo)
115117
}
116118
completionHandler()
117119
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// PushNotificationOpenHandler.swift
3+
// DevLog
4+
//
5+
// Created by opfic on 5/28/26.
6+
//
7+
8+
import Foundation
9+
import DevLogDomain
10+
11+
final class PushNotificationOpenHandler {
12+
private let trackAnalyticsEventUseCase: TrackAnalyticsEventUseCase
13+
14+
init(trackAnalyticsEventUseCase: TrackAnalyticsEventUseCase) {
15+
self.trackAnalyticsEventUseCase = trackAnalyticsEventUseCase
16+
}
17+
18+
func handlePushOpen(userInfo: [AnyHashable: Any]) {
19+
trackAnalyticsEventUseCase.execute(.pushOpen)
20+
PushNotificationRoute.shared.handlePushTap(userInfo: userInfo)
21+
}
22+
}

0 commit comments

Comments
 (0)