Skip to content

Commit 837ee37

Browse files
authored
Merge pull request #302 from teamterning/#301-์•ฐํ”Œ
[Feat] #301 - ํ‘ธ์‹œ์•Œ๋ฆผ ์ถ”์  ์ด๋ฒคํŠธ ์‹ฌ๊ธฐ
2 parents 3ba4044 + aede20d commit 837ee37

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

โ€ŽTerning-iOS/Terning-iOS/Application/AppDelegate.swiftโ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
6767
/// ํ‘ธ์‹œ ํด๋ฆญ์‹œ
6868
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async {
6969

70+
track(eventName: .pushNotificationOpened)
71+
7072
let userInfo = response.notification.request.content.userInfo
7173
if let type = userInfo["type"] as? String {
7274
PushNavigator.handlePush(type: type)
@@ -76,6 +78,8 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
7678
/// Foreground(์•ฑ ์ผœ์ง„ ์ƒํƒœ)์—์„œ๋„ ์•Œ๋ฆผ ์˜ค๋Š” ์„ค์ •
7779
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
7880

81+
track(eventName: .pushNotificationReceived)
82+
7983
completionHandler([.sound, .banner, .list])
8084
}
8185

@@ -130,3 +134,9 @@ extension AppDelegate: MessagingDelegate {
130134
// Note: This callback is fired at each app startup and whenever a new token is generated.
131135
}
132136
}
137+
138+
extension AppDelegate {
139+
public func track(eventName: AmplitudeEventType, eventProperties: [String: Any]? = nil) {
140+
AmplitudeManager.shared.track(eventType: eventName, eventProperties: eventProperties)
141+
}
142+
}

โ€ŽTerning-iOS/Terning-iOS/Resource/Amplitude/AmplitudeEventType.swiftโ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ public enum AmplitudeEventType: String {
6363
case clickNavigationSearch = "click_navigation_search" // ๋„ค๋น„๊ฒŒ์ด์…˜๋ฐ”_ํƒ์ƒ‰
6464
case clickNavigationMyPage = "click_navigation_mypage" // ๋„ค๋น„๊ฒŒ์ด์…˜๋ฐ”_๋งˆ์ดํŽ˜์ด์ง€
6565
case clickNavigationHome = "click_navigation_home" // ๋„ค๋น„๊ฒŒ์ด์…˜๋ฐ”_ํ™ˆ
66+
67+
// ํ‘ธ์‹œ์•Œ๋ฆผ
68+
case pushNotificationReceived = "push_notification_received" // ํ‘ธ์‹œ ์•Œ๋ฆผ ์ˆ˜์‹  ์‹œ
69+
case pushNotificationOpened = "push_notification_opened" // ํ‘ธ์‹œ ์•Œ๋ฆผ ํด๋ฆญ ์‹œ
6670
}

0 commit comments

Comments
ย (0)