Skip to content

Conversation

soochan8
Copy link
Collaborator

@soochan8 soochan8 commented Oct 13, 2025

๐Ÿ”– ์š”์•ฝ

  1. FirebaseService ๊ตฌํ˜„ ๋ฐ FCM ์•Œ๋ฆผ ์ฒ˜๋ฆฌ ๋กœ์ง ์ถ”๊ฐ€

๐Ÿ›  ์ž‘์—… ๋‚ด์šฉ

  1. FirebaseService
  • Notification ์ƒ์„ฑ ๋ฐ ํ‘œ์‹œํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • ํด๋ฆญ ์‹œ, ๋”ฅ๋งํฌ ์ด๋™ ์ฒ˜๋ฆฌํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  1. AndroidManifest
  • permission ๋ฐ ๋”ฅ๋งํฌ ์ธํ…ํŠธ ํ•„ํ„ฐ ์ถ”๊ฐ€ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

๐Ÿ’ก ํ…Œ์ŠคํŠธ ๋ฐฉ๋ฒ•

  • Postman์—์„œ FCM ๋ฉ”์‹œ์ง€ ์ „์†กํ•˜์—ฌ, ์•Œ๋ฆผ ์ˆ˜์‹  ๋ฐ ํด๋ฆญ ์ด๋™ ํ™•์ธํ•˜์˜€์Šต๋‹ˆ๋‹ค.

โ“ ๊ถ๊ธˆ ์‚ฌํ•ญ

  1. ๋ณดํ†ต ์‹ค๋ฌด์—์„œ ์•Œ๋ฆผ ๊ธฐ๋Šฅ์„ ์ฒ˜๋ฆฌํ•  ๋•Œ, ์ด๋Ÿฌํ•œ ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋Š” ์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์ด๋‚˜ ํšจ์œจ์ ์ธ ๋ฐฉ์•ˆ์ด ์žˆ๋‹ค๋ฉด ์—ฌ์ญค๋ณด๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

@soochan8 soochan8 requested a review from f-lab-pepe October 13, 2025 09:06
@soochan8 soochan8 self-assigned this Oct 13, 2025
@soochan8 soochan8 added the feat ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€ label Oct 13, 2025
@soochan8 soochan8 changed the title Feature/feature#60 notification pr Feature/feature#60 FCM Notification Oct 13, 2025
@HiltViewModel
class MainViewModel @Inject constructor() : ViewModel() {

private val _deepLinkNavigation = MutableSharedFlow<String>()
Copy link
Collaborator

Choose a reason for hiding this comment

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

MainActivity.onCreate()์—์„œ handleDeepLink(intent)๋ฅผ ๋จผ์ € ํ˜ธ์ถœํ•˜๊ณ , ์ดํ›„ setContent โ†’ AppNavHost์—์„œ deepLinkNavigation.collect๋ฅผ ์‹œ์ž‘ํ•˜๋Š”๋ฐ ์ง€๊ธˆ _deepLinkNavigation์€ MutableSharedFlow() ๊ธฐ๋ณธ๊ฐ’(= replay 0)์ด๋ฏ€๋กœ ์ฝœ๋“œ์Šคํƒ€ํŠธ์—์„œ emit์ด ์ˆ˜์ง‘ ์‹œ์ž‘ ์ „์— ๋ฐœ์ƒํ•˜๋ฉด ์ด๋ฒคํŠธ๊ฐ€ ์‚ฌ๋ผ์งˆ๊ฒƒ ๊ฐ™์•„์š”.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

๋„ต! SharedFlow๋Š” HotStream์ด๋ฏ€๋กœ ๋ฉ˜ํ† ๋‹˜ ๋ง์”€์ฒ˜๋Ÿผ ๋‚˜์ค‘์— emit์ด ๋œ ์‹œ์ ์— collect์„ ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ ์ด๋ฒคํŠธ๋ฅผ ๋ฐ›์ง€๋ชปํ•ด ์‚ฌ๋ผ์ง€๊ฒŒ๋ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๋ถ€๋ถ„์€ replay = 1์„ ์‚ฌ์šฉํ•˜์—ฌ emit 1๊ฐœ๋ฅผ ๋ณด์žฅํ•˜๋„๋ก ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.



val intent = if (!deeplink.isNullOrBlank()) {
Intent(Intent.ACTION_VIEW, Uri.parse(deeplink)).apply {
Copy link
Collaborator

Choose a reason for hiding this comment

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

์Šคํ‚ด๊ฒ€์‚ฌ๊ฐ€ ํ•„์š”ํ• ๊ฒƒ ๊ฐ™์•„์š”. ์™ธ๋ถ€ url์„ ์ž„์˜๋กœ ์‹คํ–‰ํ•˜๋ฉด ๋ฆฌ์Šคํฌ๊ฐ€ ํฝ๋‹ˆ๋‹ค.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

๋„ต ๊ฒ€์‚ฌ ๋กœ์ง ์ถ”๊ฐ€ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค! ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

- ํ˜„์žฌ ์‹œ์ ์ด emit ํ›„, collect์„ ํ•˜๊ณ  ์žˆ์œผ๋ฏ€๋กœ ์ด๋ฒคํŠธ๋ฅผ ์ „๋‹ฌ ๋ฐ›์„ ์ˆ˜ ์—†์–ด replay 1์„ ์‚ฌ์šฉํ•˜์—ฌ ์ตœ๊ทผ ์ด๋ฒคํŠธ 1๊ฐœ๋ฅผ ์ „๋‹ฌ๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก ๋ณด์žฅ
- ์•ˆ์ „ํ•œ ๋”ฅ๋งํฌ ํŒŒ์‹ฑ ๋ฐ ๊ฒ€์ฆ
- ํ—ˆ์šฉ๋œ ๋„๋ฉ”์ธ ๋ฐ ๋กœ์ปฌ๋งŒ ์ ‘๊ทผ ํ—ˆ์šฉ
- DeepLinkManager ์ฃผ์ž…์œผ๋กœ ์Šคํ‚ด/๋„๋ฉ”์ธ ๊ฒ€์ฆ ์ฑ…์ž„ ๋ถ„๋ฆฌ
@soochan8
Copy link
Collaborator Author

๐Ÿ”– ์š”์•ฝ

  1. deepLinkSharedFlow replay ์„ค์ •
  2. deepLink ์Šคํ‚ด ๊ฒ€์‚ฌ ๋กœ์ง

๐Ÿ›  ์ž‘์—… ๋‚ด์šฉ

  1. MainViewModel
  • SharedFlow๋Š” HotStream์œผ๋กœ emit ์‹œ์ ์— collect๊ฐ€ ์—†์œผ๋ฉด ์ด๋ฒคํŠธ๊ฐ€ ์†์‹ค๋˜์–ด ์ˆ˜์‹ ๋ฐ›์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค. ์ด์— ๋”ฐ๋ผ replay = 1์„ ์„ค์ •ํ•˜์—ฌ ์ตœ๊ทผ ์ด๋ฒคํŠธ 1๊ฐœ๋ฅผ ๋ฐ›๋„๋ก ๋ณด์žฅํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  1. DeepLinkManager, DeepLinkDestination
  • URI๋ฅผ ํ•œ ๊ณณ์— ๊ฒ€์ฆํ•˜๊ธฐ ์œ„ํ•ด DeepLinkManager๋ฅผ ์ƒˆ๋กœ ์ƒ์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • DeepLinkManager์˜ parse๋ฅผ ํ†ตํ•ด ์•ˆ์ „ํ•œ ์Šคํ‚ด ๋ฐ ๋„๋ฉ”์ธ ๊ฒ€์ฆ์„ ์ถ”๊ฐ€ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • DeepLinkDestination์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ด๋™ ๊ฒฝ๋กœ๋ฅผ sealed class๋กœ ์ถ”๊ฐ€ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

@soochan8 soochan8 requested a review from f-lab-pepe October 14, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants