Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/jaino/#160 #163

Merged
merged 16 commits into from
Mar 29, 2024
Merged

Feature/jaino/#160 #163

merged 16 commits into from
Mar 29, 2024

Conversation

jeongjaino
Copy link
Member

@jeongjaino jeongjaino commented Mar 27, 2024

1. ๐Ÿ“„ ๊ด€๋ จ๋œ ์ด์Šˆ ๋ฐ ์†Œ๊ฐœ

#160 Firebase Event Log ๊ตฌํ˜„

2. ๐Ÿ”ฅ ๋ณ€๊ฒฝ๋œ ์ 

  1. Firebase Event Log ํด๋ž˜์Šค๋ฅผ ๊ตฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • Analytics ๋ชจ๋“ˆ์„ ์ฐธ์กฐํ•˜์—ฌ, Composition Scope์—์„œ๋Š” LocalAnalyticsHelper.current๋กœ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๊ณ , ์ผ๋ฐ˜ ์ฝ”์–ด๋ชจ๋“ˆ ๋ฐ ๋ทฐ๋ชจ๋ธ์—์„œ๋Š” Hilt๋ฅผ ํ†ตํ•ด AnalyticsHelper ํด๋ž˜์Šค๋ฅผ ์ฃผ์ž…๋ฐ›์•„์„œ ๋กœ๊น…ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
  1. ๋ถˆํ•„์š”ํ•œ ํด๋ž˜์Šค๋ฅผ ์†Œ๊ฑฐํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • KtLint/Management ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ๋ ˆํฌ์— ์ž˜๋ชป ์˜ฌ๋ ค์ง„ ๊ฒƒ์„ ์†Œ๊ฑฐํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • common ๋ชจ๋“ˆ ๋‚ด ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์ต์Šคํ…์…˜์„ ์ œ๊ฑฐํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • UseCase๋‚ด HiltScope๋ฅผ ์ œ๊ฑฐํ•˜์˜€์Šต๋‹ˆ๋‹ค.

3. โœ… ๊ผญ ํ™•์ธํ•ด์คฌ์œผ๋ฉด ํ•˜๋Š” ๋ถ€๋ถ„

  • AnalyticsHelper ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
    • ์‚ฌ์šฉ๋ฒ• ์ดํ•ด์™€ ์ž˜ ๋“ค์–ด์˜ค๋Š” ์ง€ ! (1์‹œ๊ฐ„์— ํ•œ๋ฒˆ์”ฉ ์ง‘๊ณ„๋˜์–ด์„œ, ๋ฐ”๋กœ ํ™•์ธ์ด ์•ˆ๋  ์ˆ˜ ์žˆ์–ด์š”.)
    • ๋ฐ”๋กœ ํ™•์ธํ•˜๋ ค๋ฉด ADB ์—ฐ๊ฒฐํ•ด์„œ, Firebase DebugView ํ™•์ธํ•ด๋ณด์„ธ์š” ! (๋ชจ๋ฅด์‹œ๋ฉด ๊ตฌ๊ธ€์— ๊ฒ€์ƒ‰ํ•ด์„œ ๋…์Šค๋Œ€๋กœ ์ง„ํ–‰!)
  • ์ถ”๊ฐ€๋กœ ๋กœ๊น…ํ•„์š”ํ•œ ๋ถ€๋ถ„ ์–ธ๊ธ‰ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

์ถ”๊ฐ€๋กœ, Release ๋ณ‘ํ•ฉ ํ›„, Develop๋„ ๋ณ‘ํ•ฉ ์ง„ํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

4. ๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท(์„ ํƒ)

5. ๐Ÿ’ก์•Œ๊ฒŒ๋œ ํ˜น์€ ๊ถ๊ธˆํ•œ ์‚ฌํ•ญ๋“ค

@jeongjaino jeongjaino added ๐Ÿš€์ง„ํ˜ธ๐Ÿš€ ESTP ์ •์ง„ํ˜ธ 23์„ธ ๐ŸŒฑ๊ธฐ๋Šฅ๐ŸŒฑ ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๋‘๋‘๋‘ฅ์žฅ! ๐Ÿ”ฅํ•ซํ”ฝ์Šค๐Ÿ”ฅ ๋ฆด๋ฆฌ์ฆˆ ํ›„ ํ”„๋กœ๋•์…˜ ๋ ˆ๋ฒจ๋กœ ์˜ฌ๋ฆฌ๊ธฐ ์ „ ์ˆ˜์ •์ž‘์—… labels Mar 27, 2024
@jeongjaino jeongjaino self-assigned this Mar 27, 2024
@jeongjaino jeongjaino linked an issue Mar 27, 2024 that may be closed by this pull request
2 tasks
@jeongjaino jeongjaino changed the base branch from main to release March 27, 2024 16:32
@tgyuuAn tgyuuAn self-requested a review March 27, 2024 17:00
Copy link
Member

@tgyuuAn tgyuuAn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ง„ํ˜ธ ๋‹˜์ด ์˜ฌ๋ ค์ฃผ์‹  ๋ ˆํผ๋Ÿฐ์Šค๊ฐ€ ๊ทธ๋ ‡๊ฒŒ ์–ด๋ ต์ง€๋„ ์•Š๊ณ ,

compositionLocal ๋ถ€๋ถ„ ์ƒˆ๋กœ์šด ํ‚ค์›Œ๋“œ๋ฅผ ์–ป์€ ๊ฒƒ ๊ฐ™์•„์„œ ์ข‹๋„ค์š”.

์ฝ”๋“œ๋„ ์ฝ๊ธฐ ์‰ฌ์›Œ์„œ ์ข‹์•˜์–ด์š”..!

์ œ๊ฐ€ ๊ถ๊ธˆํ•œ ๋ถ€๋ถ„ ์‚ด์ง์ฟต ๋Œ“๊ธ€๋กœ ๋‹ด์•„๋ดค์–ด์š”.!







Analytics ๋ชจ๋“ˆ์„ ์ฐธ์กฐํ•˜์—ฌ, Composition Scope์—์„œ๋Š” LocalAnalyticsHelper.current๋กœ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๊ณ ,

์ผ๋ฐ˜ ์ฝ”์–ด๋ชจ๋“ˆ ๋ฐ ๋ทฐ๋ชจ๋ธ์—์„œ๋Š” Hilt๋ฅผ ํ†ตํ•ด AnalyticsHelper ํด๋ž˜์Šค๋ฅผ ์ฃผ์ž…๋ฐ›์•„์„œ ๋กœ๊น…ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

ํ™•์ธํ–ˆ์”๋‹ˆ๋‹ค.


import androidx.compose.runtime.staticCompositionLocalOf

val LocalAnalyticsHelper = staticCompositionLocalOf<AnalyticsHelper> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ๋ถ€๋ถ„ ์•ฝ๊ฐ„ ์•„๋ฆฌ๊นŒ๋ฆฌํ•œ๊ฒŒ,

Activity๊ฐ€ ํ•„์š”ํ•ด์„œ staticCompositionLocal์— Activityํ•˜๋‚˜ ์„ ์–ธํ•ด์„œ ํ•„์š”ํ•œ ๊ณณ๋งˆ๋‹ค ๋ฟŒ๋ ค์ฃผ๋Š” ๊ฒƒ ๊ฐ™์€๋ฐ์š”,

๊ตณ์ด MainActivity๊ฐ€ ์•„๋‹Œ LocalActivity๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š” ??

์•ฝ~~๊ฐ„ ์ข€ ์ดํ•ด๊ฐ€ ์•ˆ๋˜์š” ์ œ๊ฐ€ ์ด๊ฑธ ์•ˆ์จ๋ด์„œ ๊ทธ๋Ÿฐ๊ฐ€ ใ… 







์ง„ํ˜ธ๋‹˜์ด ์˜ฌ๋ ค์ฃผ์‹  ์งฑ์งฑํ•œ ๋ ˆํผ๋Ÿฐ์Šค์— ํ•ด๋‹น ๋ถ€๋ถ„์„ ๋ด๋„ ์ž˜ ์ดํ•ด๊ฐ€...

์ผ๋‹จ A to Z๋กœ ๋‹ค ๊ฐ€๋ฅด์ณ ์ฃผ๊ธด ํ•˜๋Š”๋ฐ ์šฉ๋„๊ฐ€ ๋„ˆ๋ฌด ๊ถ๊ธˆํ•˜๋„ค์š”.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์˜ค ํƒœ๊ทœ์ƒ ์ œ๊ฐ€ ํ•ด๋‹น ๋ธ”๋กœ๊ทธ๋ฅผ ๋ณด๋ƒˆ์—ˆ๋„ค์š” !

์ด๋ฒˆ ๊ตฌํ˜„ํ•˜๋ฉด์„œ, ํ•ด๋‹น ๋ธ”๋กœ๊ทธ๋Š” ์ฐธ์กฐํ•˜์ง€ ์•Š์•˜์–ด์š” ,,, ใ…Žใ…Ž

์ œ๊ฐ€ ์›ํ•˜๋˜ ๋ฐฉ์‹์ด ์•„๋‹ˆ์˜€๊ฑฐ๋“ ์š”.

์ œ๊ฐ€ ์ฐธ์กฐํ•œ ๋ฐฉ์‹์€ nowInAndroid์˜ analytics ๋ชจ๋“ˆ์„ ์ฐธ์กฐํ–ˆ์–ด์š”.

CompositionLocal์€ ์ด์ „ MainActivity์—์„œ Screen๊นŒ์ง€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌํ•˜๋Š” ๋ฐฉ์‹์ด ์•„๋‹ˆ๋ผ,

ํŠธ๋ฆฌ ๋ฐ”๊นฅ์— ์„ ์–ธํ•ด๋†“๊ณ , UiํŠธ๋ฆฌ ์–ด๋””์„œ๋“ ์ง€ ๊บผ๋‚ด์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์–ด์š” !
(์ €ํฌ Color, Typograp๋„ ์•Œ๊ฒŒ ๋ชจ๋ฅด๊ฒŒ ์ „๋‹ฌ ์—†์ด ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ์š” ใ…Žใ…Ž)

ํ•ด๋‹น ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŒ…๊ณผ ๋‹ค๋ฅด๊ฒŒ, ์ €๋Š” Firebase Analytics์— ๋กœ๊น…์„ ์ˆ˜ํ–‰ํ•˜๋Š”
AnalyticsHelper ํด๋ž˜์Šค๋ฅผ ๊ทธ๋Œ€๋กœ CompositionLocal๋กœ ์„ ์–ธํ–ˆ์–ด์š”.

์ผ๋ฐ˜์ ์ธ LifeCycleScope๋‚˜ CoroutinScope์™€ ๋‹ค๋ฅด๊ฒŒ, CompositionScope๋‚ด์—์„œ ์‰ฝ๊ฒŒ ์ ‘๊ทผํ•˜๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด์„œ์ฃ  !

์ด๊ฒŒ ๋ณด๊ธฐ์—๋Š” ์–ด๋ ต๊ฒŒ ๋ณด์ด๋Š”๋ฐ, ์‹ค์ œ๋กœ๋Š” ํžํŠธ๋ž‘ ์ €๋Š” ์œ ์‚ฌํ•˜๋‹ค๋Š” ๋Š๋‚Œ์ด ๋“ค์—ˆ์–ด์š”.

ํ˜„์žฌ ํƒœ๊ทœ๋‹˜์ด ๋ฆฌ๋ทฐ ๋‹ฌ์•„์ฃผ์‹  ์„ ์–ธ๋ถ€๊ฐ€ ์ธํ„ฐํŽ˜์ด์Šค๊ณ , MainActivity๋‚ด์—์„œ ์ฃผ์ž…ํ•˜๋Š” ๊ฒƒ์ฒ˜๋Ÿผ์š” !

@@ -3,7 +3,7 @@ plugins {
}

android {
namespace = "com.wap.wapp.core.base"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ—ˆ๊ฑฐ๋ฉ

Comment on lines +3 to +16
data class AnalyticsEvent(
val type: String,
val extras: List<Param> = emptyList(),
) {
data class Param(
val key: String,
val value: String,
)

companion object {
const val SCREEN_VIEW = "screen_view" // TYPE
const val SCREEN_NAME = "screen_name" // EXTRA_KEY
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ๋ถ€๋ถ„ ์ž˜ ์ดํ•ด๊ฐ€ ์•ˆ๋˜๋Š” ๊ฒŒ,

screen_viewํ•˜๊ณ  screen_nameํ•˜๊ณ  ์ฐจ์ด์ ์„ ์ž˜ ๋ชจ๋ฅด๊ฒ ์–ด์š”.

์•„๋งˆ๋„.. ์ œ ์˜ˆ์ƒ์ปจ๋Œ€ ์ € ์ƒ์ˆ˜๊ฐ’์€ Log์ฐ์„ ๋•Œ TAG ๋ถ€๋ถ„์— ํ•ด๋‹นํ•˜๋Š” ๊ฒƒ ์ฒ˜๋Ÿผ key ๊ฐ’์œผ๋กœ ๋“ค์–ด๊ฐ€๋Š” ๊ฒƒ ๊ฐ™์€๋ฐ..

๋งž๋‚˜์š”..?

view ์™€ name์˜ ์ฐจ์ด๊ฐ€ ๋ญ์ฃ  ใ… ใ… ? ์ปดํฌ๋„ŒํŠธ ๋‹จ์œ„์™€ ํ™”๋ฉด ๋‹จ์œ„์˜ ์ฐจ์ด์ธ๊ฐ€ ..?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firebase Analytics Event์˜ ๊ตฌํ˜„๋ถ€๋Š” ๋‘๊ฐ€์ง€๋กœ ๋˜์–ด์žˆ์–ด์š” !

  1. ์ด๋ฒคํŠธ ์ด๋ฆ„ (์–ด๋–ค ์ด๋ฒคํŠธ์ธ๊ฐ€?_
  2. ์ด๋ฒคํŠธ ๋ฒˆ๋“ค (๋นˆ ๊ฐ’์ด์—ฌ๋„ ๊ฐ€๋Šฅํ•ด์š”, ํ‚ค-๊ฐ’์˜ ํ˜•ํƒœ๋กœ ํ•ด๋‹น ์ด๋ฒคํŠธ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฐ’์„ ๋ณดํ†ต ๋„ฃ์–ด์š”)

์ด๋ ‡๊ฒŒ ๋ณด๋ฉด, ์ด๋ฒคํŠธ ์ด๋ฆ„ -> Type, ์ด๋ฒคํŠธ ๋ฒˆ๋“ค -> Param์œผ๋กœ ์ •ํ–ˆ์–ด์š”

๊ทธ๋Ÿผ ?
์ด๋ฒคํŠธ ์ด๋ฆ„ : ScreenView,
์ด๋ฒคํŠธ ๋ฒˆ๋“ค : Key -> ScreenName, Value -> ManagementSurveyScreen

ํ•œ๊ธ€๋กœ ํ’€์–ด์“ด๋‹ค๋ฉด ?
ScreenView์˜ ์ด๋ฒคํŠธ๋ฅผ ๊ธฐ๋กํ•˜๋Š”๋ฐ, ScreenName์ด ManagementSurveyScreen์ธ ์ด๋ฒคํŠธ๋ฅผ ๊ธฐ๋ก !

Comment on lines +21 to +27
@Composable
fun TrackScreenViewEvent(
screenName: String,
analyticsHelper: AnalyticsHelper = LocalAnalyticsHelper.current,
) = LaunchedEffect(Unit) {
analyticsHelper.logScreenView(screenName)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ•ด๋‹น ํ•จ์ˆ˜๋ฅผ LaunchedEffect๋กœ ๊ฐ์‹ธ๋Š” ์ด์œ ๋Š” suspend ๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•จ ๋ณด๋‹ค๋Š”,

๋ฉ”์ธ ์Šค๋ ˆ๋“œ์— ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š๊ธฐ ์œ„ํ•ด์„œ ๋ฐฑ๊ทธ๋ผ์šด๋“œ๋กœ ๋™์ž‘์‹œํ‚ค๊ธฐ ์œ„ํ•จ ์ด ๋งž์„๊นŒ์š” ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analytics ๋‚ด๋ถ€ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ•ด๋ณด์ง€ ์•Š์•˜์ง€๋งŒ, ์ œ๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ ๋‚ด์—์„œ๋Š” suspend๊ฐ€ ์—†์–ด์š” !

LaunchEffect๋กœ ๊ฐ์‹ผ์ด์œ ๋Š”

  1. ์—„์—ฐํžˆ ์„œ๋ฒ„์— ๋กœ๊น…ํ•˜๋Š” ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ž‘์—…
  2. ์ปดํฌ์ง€์…˜ ์Šค์ฝ”ํ”„ ๋‚ด์—์„œ, ์•ˆ์ „ํ•˜๊ฒŒ ์ผํšŒ์„ฑ์œผ๋กœ ํ˜ธ์ถœ

@tgyuuAn tgyuuAn added the ๐Ÿ”ฅ๋ฆฌ๋ทฐ ๊ธฐ๋‹ค๋ฆฌ๋Š” ์ค‘๐Ÿ”ฅ PR์„ ์˜ฌ๋ฆฌ๊ณ  ์ฝ”๋“œ๋ฆฌ๋ทฐ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ๋Š” ์ƒํƒœ์ž…๋‹ˆ๋‹ค. label Mar 28, 2024
@tgyuuAn
Copy link
Member

tgyuuAn commented Mar 28, 2024

image

์Œ ์ด๊ฑฐ ํ•ด๋‹น ํ™”๋ฉด ๋ณ„๋กœ ๋กœ๊ทธ๊ฐ€ ์ฐํžˆ๋Š” ๊ฒƒ์ด ์•„๋‹Œ๊ฐ€์š” ?!

์•„๋‹ˆ๋ฉด ์•„์ง ๋ฐ˜์˜๋˜์ง€ ์•Š์€ ๊ฒƒ์ธ๊ฐ€ ?!

@tgyuuAn tgyuuAn added ๐ŸŒŸ๋จธ์ง€ ํ•ด์ฃผ์„ธ์š”๐ŸŒŸ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๊ฐ€ ์™„๋ฃŒ๋œ ๋’ค PR์„ ์˜ฌ๋ฆฐ์‚ฌ๋žŒ์ด Merge๋ฅผ ํ•˜๋ฉด ๋˜๋Š” ๋‹จ๊ณ„์ž…๋‹ˆ๋‹ค. ๐Ÿ”ฅ๋ฆฌ๋ทฐ ๊ธฐ๋‹ค๋ฆฌ๋Š” ์ค‘๐Ÿ”ฅ PR์„ ์˜ฌ๋ฆฌ๊ณ  ์ฝ”๋“œ๋ฆฌ๋ทฐ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ๋Š” ์ƒํƒœ์ž…๋‹ˆ๋‹ค. and removed ๐Ÿ”ฅ๋ฆฌ๋ทฐ ๊ธฐ๋‹ค๋ฆฌ๋Š” ์ค‘๐Ÿ”ฅ PR์„ ์˜ฌ๋ฆฌ๊ณ  ์ฝ”๋“œ๋ฆฌ๋ทฐ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ๋Š” ์ƒํƒœ์ž…๋‹ˆ๋‹ค. ๐ŸŒŸ๋จธ์ง€ ํ•ด์ฃผ์„ธ์š”๐ŸŒŸ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๊ฐ€ ์™„๋ฃŒ๋œ ๋’ค PR์„ ์˜ฌ๋ฆฐ์‚ฌ๋žŒ์ด Merge๋ฅผ ํ•˜๋ฉด ๋˜๋Š” ๋‹จ๊ณ„์ž…๋‹ˆ๋‹ค. labels Mar 28, 2024
@jeongjaino
Copy link
Member Author

image

์Œ ์ด๊ฑฐ ํ•ด๋‹น ํ™”๋ฉด ๋ณ„๋กœ ๋กœ๊ทธ๊ฐ€ ์ฐํžˆ๋Š” ๊ฒƒ์ด ์•„๋‹Œ๊ฐ€์š” ?!

์•„๋‹ˆ๋ฉด ์•„์ง ๋ฐ˜์˜๋˜์ง€ ์•Š์€ ๊ฒƒ์ธ๊ฐ€ ?!

ํƒœ๊ทœ์ƒ ์ €๋„ ๋‚˜์ค‘์— ํ™•์ธํ•ด๋ณผ๊ฒŒ์š” !

ํ˜น์‹œ Firebase ํƒญ๋‚ด์—์„œ DebugView์—์„œ ํ™•์ธํ•˜์‹ ๊ฒŒ ๋งž์„๊นŒ์š” ??

Copy link
Member

@tgyuuAn tgyuuAn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์†Œ์†Œํ•œ ์ฝ”๋ฉ˜ํŠธ ๋‹ฌ์•„๋ด์”๋‹ˆ๋‹ค!!!!!!!!

@@ -63,6 +68,7 @@ internal fun SignInRoute(
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
internal fun SignInScreen(
viewModel: SignInViewModel,
Copy link
Member

@tgyuuAn tgyuuAn Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ง„ํ˜ธ์ƒ Screen์— ViewModel์„ ์ฃผ์ž…ํ•˜๋Š” ๊ฒƒ ๋ณด๋‹ค route์—์„œ viewModel์˜ ํ–‰์œ„๋ฅผ ๋„˜๊ฒจ์ค˜์„œ,

๋กœ์ง์„ Screen์—์„œ ์ •ํ•˜๊ธฐ ๋ณด๋‹ค๋Š” Route์—์„œ ์ •์˜ํ•˜๋Š” ๊ฒƒ์œผ๋กœ, ํ–‰์œ„์˜ ์ฃผ์ฒด๋ฅผ ์—ญ์ „์‹œํ‚ค๋Š” ๊ฒƒ์ด ์–ด๋–จ๊นŒ์š”?!

xml์—์„œ MVVM ์“ฐ๋“ฏ์ด, Screen์—์„œ ํ–‰์œ„๋ฅผ ๊ฒฐ์ •ํ•  ์ˆ˜ ์—†๋„๋ก ๋งŒ๋“œ๋Š” ๊ฑฐ์š”!

https://www.charlezz.com/?p=45623

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ตณ์ด viewModel์„ ๋„˜๊ธธํ•„์š” ์—†์ด

๋กœ๊ทธ ์ฝœ๋ฐฑ์„ ๋งŒ๋“ค์–ด์„œ ์‚ฌ์šฉํ•ด์„œ ๊ตฌํ˜„์€ ๊ฐ€๋Šฅํ•  ๊ฒƒ ๊ฐ™์•„์š” !

๊ทธ๋Ÿฐ๋ฐ ํƒœ๊ทœ๋‹˜๊ป˜์„œ ๋ง์”€ํ•˜์‹  ํ–‰์œ„ ์ฃผ์ฒด์˜ ์—ญ์ „์ด๋ผ๋Š” ์˜๋ฏธ๋ฅผ ์ž˜ ๋ชจ๋ฅด๊ฒ ์•„์š” ,,!

๊ฒฐ๊ตญ ์–ด๋””์„ ๊ฐ€๋Š” ๋ทฐ๋ชจ๋ธ ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•ด์•ผ ํ•˜๊ณ ,
ํ•ด๋‹น ๋ถ€๋ถ„์ด ์Šคํฌ๋ฆฐ -> ๋ผ์šฐํŠธ๋กœ ๋ณ€๊ฒฝ๋˜๋Š” ๊ฒƒ์ธ๋””์š” ์ ์‹œ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeongjaino ์‹ค์งˆ์ ์œผ๋กœ UI๋ฅผ ๊ทธ๋ฆฌ๋Š” Screen์—์„œ ViewModel์˜ ์–ด๋–ค ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•  ์ง€๋ฅผ ๊ฒฐ์ •ํ•˜์ง€ ๋ง๊ณ  Route์—์„œ ํ•จ์ˆ˜๋ฅผ ๋„˜๊ฒจ์ค˜์„œ ๋„˜๊ฒจ์ง„ ๊ฒƒ์„ ๋ฐ›์•„๋จน๋Š” ์‹์œผ๋กœ ํ•˜๋Š” ๊ฒƒ์ด ์–ด๋– ๋ƒ๋Š” ๋œป์ด์—ˆ์–ด์š”.

์ง€๊ธˆ์€ Screen์—์„œ ViewModel์˜ ํ•จ์ˆ˜๋ฅผ ๋งˆ์Œ๋Œ€๋กœ ํ˜ธ์ถœํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ๊ทธ๋ ‡๊ฒŒ ๋˜๋ฉด UI๋ž‘ ๊ด€๋ จ์—†๋Š” Route์—์„œ ์ฃผ๋Š” ๋Œ€๋กœ ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•˜๋‹ˆ๊นŒ์š”.

์ฆ‰ Screen์€ UI์˜์—ญ๋งŒ ์ผ์„ ํ•  ์ˆ˜ ์žˆ๊ณ  ํ•จ์ˆ˜ ํ˜ธ์ถœ๊ณผ ๊ฐ™์€ ์ผ๋“ค์€ Screen๋ณด๋‹ค ์ƒ์œ„ ๋ ˆ์ด์–ด์ด๋ฉด์„œ UI๋ž‘์€ ๊ด€๋ จ์—†๋Š” Route์—์„œ ํ•˜๋Š” ๊ฒƒ์ด์ฃ .







++

์ด์™€ ๊ด€๋ จ๋œ ๊ธ€์„ ์–ด๋””์„œ ๋ดค๋”๋ผ.. ํ–ˆ๋Š”๋ฐ compositionLocal ์„ ๊ณต๋ถ€ํ•˜๋ฉด์„œ ์•„๋ž˜ ๊ฒŒ์‹œ๊ธ€์ด์„œ ๋ดค์—ˆ๋„ค์š”.

image

https://velog.io/@jaewonkim1468/JetpackCompose9-CompositionLocal

์ด๋ ‡๊ฒŒ ํ•จ์˜ ์ด์œ ๋Š” ํ•จ์ˆ˜๋ฅผ ์ฃผ์ž…๋ฐ›๋Š” ํ•จ์ˆ˜๋‚˜ ํด๋ž˜์Šค์˜ ์žฌ์‚ฌ์šฉ์„ฑ์„ ์œ„ํ•จ์ธ๋ฐ,

Compose๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋Š” @Preview๋ฅผ ์‚ฌ์šฉํ•จ์„ ์œ„ํ•จ์ด๋ผ๊ณ ๋„ ๋ณผ ์ˆ˜ ์žˆ๊ฒ ๋„ค์š”...







์ €ํฌ๋Š” ์ง€๊ธˆ screen๋งˆ๋‹ค Preview๋ฅผ ์•ˆ๋‹ฌ์•„๋†จ์œผ๋‹ˆ ํ•„์š”์—†๋‹ค๊ณ  ๋ณผ ์ˆ˜๋„ ์žˆ๊ฒ ๊ตฐ์š”.

์ €๋„ ์ฒ˜์Œ์—๋Š” "๋‹ค๋“ค ์ด๋ ‡๊ฒŒ ํ•˜๋‹ˆ๊นŒ ๋‹น์—ฐํžˆ ํ•ด์•ผ์ง€" ๋ผ๋Š” ์‹์œผ๋กœ ๊ตฌํ˜„์„ ํ•˜๊ธด ํ–ˆ๋Š”๋ฐ,,

์ฐพ์•„๋ณด๋‹ˆ ์ง€๊ธˆ ์ƒํ™ฉ์—์„œ๋Š” ํ•„์š” ์—†์„ ์ˆ˜๋„ ์žˆ๊ฒ ๋‹ค ๋ผ๋Š” ์ƒ๊ฐ์ด ๋“œ๋„ค์š”.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๋Š” ์ข‹์€ ๊ฒƒ ๊ฐ™์•„์š”.

๊ตณ์ด ViewModel์„ ๋„˜๊ธธ ํ•„์š”๋„ ์—†๊ณ , ViewModel์„ ์—ฌ๋Ÿฌ๊ณณ์— ๋„˜๊ฒจ๋ฒ„๋ฆฌ๋‹ค๊ฐ€
ViewModel์— ๋Œ€ํ•œ ์ ‘๊ทผ์ด ๋งŽ์•„์ง€๋ฉด ๊ด€๋ฆฌํ•˜๊ธฐ๋„ ์–ด๋ ค์šฐ๋‹ˆ๊นŒ์š”.

ํ–‰์œ„ ์ฃผ์ฒด์˜ ์—ญ์ „์ด๋ผ๋Š” ์˜๋ฏธ๋ฅผ ์ž˜ ๋ชจ๋ฅด๊ฒ ์–ด์„œ ๋ฌผ์–ด๋ดค์Šต๋‹ˆ๋‹ค
๊ฒฐ๊ตญ์€ Screen์ด๋‚˜ ๋ผ์šฐํŠธ๋‚˜ ๋ณ„ ์˜๋ฏธ๊ฐ€ ์—†๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์—ˆ๋Š”๋ฐ,

์ƒ๊ฐ๋„ ํ•ด๋ณด๊ณ , ํƒœ๊ทœ์ƒ ์˜๊ฒฌ๋„ ๋“ค์œผ๋‹ˆ Screen์€ ๋ง ๊ทธ๋Œ€๋กœ ํ™”๋ฉด์— ๋Œ€ํ•œ ์ปดํฌ์ €๋ธ”์„ ๋‹ด๊ณ ์žˆ๊ณ ,
๋ผ์šฐํŠธ๋Š” ํ™”๋ฉด์„ ๊ทธ๋ฆฌ๋Š” ์ปดํฌ์ €๋ธ”๊ณผ๋Š” ๋‚˜๋ฆ„ ๋ฌด๊ด€ํ•˜๋‹ˆ, ์˜ฌ๋ฆฌ๋Š”๊ฒŒ ์ข‹์•„๋ณด์ž…๋‹ˆ๋‹ค.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ˆ˜์™„ (์ˆ˜์ •์™„๋ฃŒ ์บฌ์บฌ(

Comment on lines 214 to 221
AuthState.SIGN_IN -> {
logUserSignedIn()
navigateToNotice()
}

AuthState.SIGN_UP -> {
navigateToSignUp()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ๋ถ€๋ถ„ ๋ฉ”์†Œ๋“œ ํ•˜๋‚˜๋กœ ๋ฌถ์–ด์„œ ๋„˜๊ฒจ์ฃผ๋Š” ๊ฒƒ์€ ๋ณ„๋กœ์ผ๊นŒ์š” ??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle ~~()๋กœ ๊ตฌํ˜„์€ ๊ฐ€๋Šฅํ•  ๊ฒƒ ๊ฐ™์•„์š” !

ํ•˜์ง€๋งŒ ๊ตฌํ˜„๋ถ€๊ฐ€, ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๋ถ€๋ถ„์ด๋ผ,, ์ €๋Š” ๋ถ„๋ฆฌ์˜ ํ•„์š”์„ฑ์„ ํฌ๊ฒŒ ๋ชป๋Š๋ผ๊ฒ ์–ด์š”

ํ˜น์‹œ ํƒœ๊ทœ๋‹˜์ด ์ƒ๊ฐํ•˜์‹ , ๋ถ„๋ฆฌํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์€ ์ด์œ ๋ฅผ ์•Œ๋ ค์ฃผ์‹ค ์ˆ˜ ์žˆ์œผ์‹ค๊นŒ์š”??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Composable
private fun SignInButton(
    email: String,
    coroutineScope: CoroutineScope,
    signInUseCase: SignInUseCase,
    logUserSignedIn: () -> Unit,
    navigateToNotice: () -> Unit,
    navigateToSignUp: () -> Unit,
    snackBarHostState: SnackbarHostState,
) {

ํ•ด๋‹น ๋กœ์ง์ด SignInButton์ด๋ผ๋Š” ์ปดํฌ๋„ŒํŠธ์—์„œ ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋Š”๋ฐ,

์–ด์งœํ”ผ when์ ˆ์—์„œ SignIn์„ ํƒ€๊ณ  ํ•ด๋‹น ๋ฉ”์†Œ๋“œ ๋‘๊ฐœ๋ฅผ ํ˜ธ์ถœํ•ด์•ผํ•˜๋Š” ์ƒํ™ฉ์ด๋ผ๋ฉด,

ํ•˜๋‚˜์˜ ๋ฉ”์†Œ๋“œ๋งŒ ํ˜ธ์ถœํ•˜๊ฒŒ ๋ฐ”๊พธ์–ด์„œ ๋ถˆํ•„์š”ํ•œ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ํ•˜๋‚˜๋ผ๋„ ์ค„์ผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”.

์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š” ?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์Œ ํƒœ๊ทœ์ƒ ์ œ๊ฐ€ ์ดํ•ด๋ฅผ ์ œ๋Œ€๋กœ ํ•œ์ง€ ๋ชจ๋ฅด๊ฒ ๋Š”๋ฐ,

๊ตฌ์ฒด์ ์œผ๋กœ ๋ณด์ž๋ฉด, NativgateNotice() ๋‚ด๋ถ€์—, ๋กœ๊น…ํ•จ์ˆ˜๋ฅผ ์ˆ˜ํ–‰ํ•˜์ž๋Š” ๋ง์”€์ด์‹ค๊นŒ์š” ??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Composable
internal fun SignInRoute(
    viewModel: SignInViewModel = hiltViewModel(),
    signInUseCase: SignInUseCase,
    navigateToSignUp: () -> Unit,
    navigateToNotice: () -> Unit,
) {
    SignInScreen(
        signInUseCase = signInUseCase,
        navigateToSignUp = navigateToSignUp,
        navigateToNotice = {
            viewModel.logUserSignedIn()
            navigateToNotice()
        },
    )
}

๋‹ค์Œ๊ณผ ๊ฐ™์ด, ๋ผ์šฐํŠธ ๋‚ด์—์„œ ์ˆ˜ํ–‰ํ•˜๋„๋ก ๋ง์”€ํ•˜์‹ ๊ฒŒ ๋งž์„๊นŒ์š”
??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋งž๊ธดํ•ฉ๋‹ˆ๋‹ค. ๊ฑฐ๊ธฐ์— ๋žŒ๋‹ค ํŒŒ๋ผ๋ฏธํ„ฐ ๋„ค์ด๋ฐ๋งŒ ๋ฐ”๊พธ๋Š”?.?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ตฌ๋‘ ํ˜‘์˜ ํ›„
image

Comment on lines +47 to +61
analyticsHelper.logEvent(
AnalyticsEvent(
type = "signed_out",
extras = listOf(
AnalyticsEvent.Param(
key = "user_id",
value = userProfile.userId,
),
AnalyticsEvent.Param(
key = "user_name",
value = userProfile.userName,
),
),
),
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„ํ•ญ ์š”๋ก ์‹์œผ๋กœ ์“ฐ๋Š” ๊ฑฐ๊ตฐ๋‡จ ๐Ÿ‘๐Ÿ‘

@tgyuuAn
Copy link
Member

tgyuuAn commented Mar 28, 2024

image
์Œ ์ด๊ฑฐ ํ•ด๋‹น ํ™”๋ฉด ๋ณ„๋กœ ๋กœ๊ทธ๊ฐ€ ์ฐํžˆ๋Š” ๊ฒƒ์ด ์•„๋‹Œ๊ฐ€์š” ?!
์•„๋‹ˆ๋ฉด ์•„์ง ๋ฐ˜์˜๋˜์ง€ ์•Š์€ ๊ฒƒ์ธ๊ฐ€ ?!

ํƒœ๊ทœ์ƒ ์ €๋„ ๋‚˜์ค‘์— ํ™•์ธํ•ด๋ณผ๊ฒŒ์š” !

ํ˜น์‹œ Firebase ํƒญ๋‚ด์—์„œ DebugView์—์„œ ํ™•์ธํ•˜์‹ ๊ฒŒ ๋งž์„๊นŒ์š” ??

์•… DebugView๊ฐ€ ์•„๋‹ˆ๋ผ Realtime Analytics๋กœ ํ™•์ธํ–ˆ๋„ค์š”... ๋‚ด์ผ ์•„์นจ์— ํ™•์ธํ•ด๋ณด๊ฒ ์”๋‹ˆ๋‹ท

@tgyuuAn
Copy link
Member

tgyuuAn commented Mar 29, 2024

LGTM!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@tgyuuAn tgyuuAn added ๐ŸŒŸ๋จธ์ง€ ํ•ด์ฃผ์„ธ์š”๐ŸŒŸ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๊ฐ€ ์™„๋ฃŒ๋œ ๋’ค PR์„ ์˜ฌ๋ฆฐ์‚ฌ๋žŒ์ด Merge๋ฅผ ํ•˜๋ฉด ๋˜๋Š” ๋‹จ๊ณ„์ž…๋‹ˆ๋‹ค. and removed ๐Ÿ”ฅ๋ฆฌ๋ทฐ ๊ธฐ๋‹ค๋ฆฌ๋Š” ์ค‘๐Ÿ”ฅ PR์„ ์˜ฌ๋ฆฌ๊ณ  ์ฝ”๋“œ๋ฆฌ๋ทฐ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ๋Š” ์ƒํƒœ์ž…๋‹ˆ๋‹ค. labels Mar 29, 2024
@jeongjaino jeongjaino merged commit bc31171 into release Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐ŸŒŸ๋จธ์ง€ ํ•ด์ฃผ์„ธ์š”๐ŸŒŸ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๊ฐ€ ์™„๋ฃŒ๋œ ๋’ค PR์„ ์˜ฌ๋ฆฐ์‚ฌ๋žŒ์ด Merge๋ฅผ ํ•˜๋ฉด ๋˜๋Š” ๋‹จ๊ณ„์ž…๋‹ˆ๋‹ค. ๐ŸŒฑ๊ธฐ๋Šฅ๐ŸŒฑ ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๋‘๋‘๋‘ฅ์žฅ! ๐Ÿ”ฅํ•ซํ”ฝ์Šค๐Ÿ”ฅ ๋ฆด๋ฆฌ์ฆˆ ํ›„ ํ”„๋กœ๋•์…˜ ๋ ˆ๋ฒจ๋กœ ์˜ฌ๋ฆฌ๊ธฐ ์ „ ์ˆ˜์ •์ž‘์—… ๐Ÿš€์ง„ํ˜ธ๐Ÿš€ ESTP ์ •์ง„ํ˜ธ 23์„ธ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE]: Firebase Event Log ๊ตฌํ˜„
2 participants