File tree Expand file tree Collapse file tree 13 files changed +38
-33
lines changed
Expand file tree Collapse file tree 13 files changed +38
-33
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,6 @@ struct SearchService: SearchServiceProtocol {
101101 offset: offset,
102102 limit: searchState. perPage)
103103 let models : [ Lecture ] = dtos. map { Lecture ( from: $0) }
104- FirebaseAnalyticsLogger ( ) . logEvent ( . searchLecture( . init(
105- query: searchState. searchText,
106- quarter: currentTimetable. quarter. longString ( ) ,
107- page: searchState. pageNum
108- ) ) )
109104 searchState. searchResult = offset == 0 ? models : ( searchState. searchResult ?? [ ] ) + models
110105 }
111106
@@ -116,6 +111,12 @@ struct SearchService: SearchServiceProtocol {
116111 }
117112 searchState. pageNum = 0
118113 try await _fetchSearchResult ( )
114+ if let current = timetableState. current {
115+ FirebaseAnalyticsLogger ( ) . logEvent ( . searchLecture( . init(
116+ query: searchState. searchText,
117+ quarter: current. quarter. longString ( )
118+ ) ) )
119+ }
119120 }
120121
121122 func fetchMoreSearchResult( ) async throws {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ struct MenuSheet: View {
9393 }
9494 }
9595 }
96- . analyticsScreen ( . timetableMenu, isVisible : isOpen)
96+ . analyticsScreen ( . timetableMenu, shouldLogEvent : isOpen)
9797 }
9898 }
9999}
Original file line number Diff line number Diff line change @@ -71,6 +71,6 @@ struct MenuThemeSheet: View {
7171 Spacer ( )
7272 }
7373 }
74- . analyticsScreen ( . themePreview, isVisible : isOpen)
74+ . analyticsScreen ( . themePreview, shouldLogEvent : isOpen)
7575 }
7676}
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ struct FilterSheetScene: View {
3535 FilterSheetContent ( viewModel: viewModel)
3636 }
3737 }
38- . analyticsScreen ( . searchFilter, isVisible : viewModel. isFilterOpen)
38+ . analyticsScreen ( . searchFilter, shouldLogEvent : viewModel. isFilterOpen)
3939 . ignoresSafeArea ( . keyboard)
4040 }
4141}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ struct LoginScene: View {
6868 . disabled ( isButtonDisabled)
6969 . animation ( . customSpring, value: isButtonDisabled)
7070 }
71- . analyticsScreen ( . login)
71+ . analyticsScreen ( . login, shouldLogEvent : viewModel . appState . user . accessToken == nil )
7272 . padding ( )
7373 . navigationTitle ( changeTitle ? " 아이디 입력 " : " 로그인 " )
7474 . navigationBarTitleDisplayMode ( . inline)
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ struct OnboardScene: View {
112112 Spacer ( ) . frame ( height: proxy. size. height * 0.05 )
113113 }
114114 . transition ( . scale( scale: 1 ) )
115- . analyticsScreen ( . onboard)
115+ . analyticsScreen ( . onboard, shouldLogEvent : viewModel . appState . user . accessToken == nil )
116116 }
117117 } else {
118118 VStack {
Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ struct PopupScene: View {
2121 PopupView ( popup: currentPopup,
2222 dismiss: viewModel. dismiss ( popup: dontShowForWhile: ) )
2323 . padding ( . horizontal, reader. size. width * 0.1 )
24- . analyticsScreen ( . popup)
2524 }
2625 }
2726 }
2827 . animation ( . customSpring, value: viewModel. currentPopup? . id)
28+ . onChange ( of: viewModel. currentPopup? . id) { newPopupId in
29+ if newPopupId != nil {
30+ FirebaseAnalyticsLogger ( ) . logScreen ( . popup)
31+ }
32+ }
2933 . onLoad {
3034 await viewModel. getRecentPopupList ( )
3135 }
Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ struct ThemeSettingScene: View {
5151 theme: viewModel. newTheme,
5252 themeType: . new
5353 )
54- . analyticsScreen ( . themeCustomNew)
5554 }
5655 }
5756 . accentColor ( Color ( UIColor . label) )
@@ -64,7 +63,6 @@ struct ThemeSettingScene: View {
6463 theme: viewModel. targetTheme ?? viewModel. newTheme,
6564 themeType: . basic
6665 )
67- . analyticsScreen ( . themeBasicDetail)
6866 }
6967 }
7068 . accentColor ( Color ( UIColor . label) )
@@ -76,17 +74,6 @@ struct ThemeSettingScene: View {
7674 theme: viewModel. targetTheme ?? viewModel. newTheme,
7775 themeType: . custom
7876 )
79- . analyticsScreen ( . themeCustomEdit)
80- }
81- . accentColor ( Color ( UIColor . label) )
82- } )
83- . sheet ( isPresented: $viewModel. isDownloadedThemeSheetOpen, content: {
84- NavigationView {
85- ThemeDetailScene (
86- viewModel: . init( container: viewModel. container) ,
87- theme: viewModel. targetTheme ?? viewModel. newTheme,
88- themeType: . downloaded
89- )
9077 }
9178 . accentColor ( Color ( UIColor . label) )
9279 } )
Original file line number Diff line number Diff line change @@ -71,8 +71,6 @@ public struct SearchLectureParameter: Encodable {
7171
7272 /// 예: "2022년 겨울학기"
7373 let quarter : String
74-
75- let page : Int
7674}
7775
7876extension AnalyticsEvent {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public enum AnalyticsScreen: SnakeCaseConvertible {
3838 case themeCustomNew
3939 case themeCustomEdit
4040 case themePreview
41+ case themeDownloaded
4142
4243 case vacancy
4344 case popup
You can’t perform that action at this time.
0 commit comments