-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/feature#60 FCM Notification #61
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
base: feature/feature#60_notification
Are you sure you want to change the base?
Feature/feature#60 FCM Notification #61
Conversation
- POST_NOTIFICATIONS ์ค์
- ๋ฅ๋งํฌ(coupon) ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ
- ViewModel์ deepLinkNavigation collect ํ, webView ํ๋ฉด ์ด๋
- Notification ํ์ ๋ฐ ํด๋ฆญ ์ ๋ฅ๋งํฌ ํ๋ฉด ์ด๋ - PendingIntent ์ฒ๋ฆฌ
@HiltViewModel | ||
class MainViewModel @Inject constructor() : ViewModel() { | ||
|
||
private val _deepLinkNavigation = MutableSharedFlow<String>() |
There was a problem hiding this comment.
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์ด ์์ง ์์ ์ ์ ๋ฐ์ํ๋ฉด ์ด๋ฒคํธ๊ฐ ์ฌ๋ผ์ง๊ฒ ๊ฐ์์.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์คํด๊ฒ์ฌ๊ฐ ํ์ํ ๊ฒ ๊ฐ์์. ์ธ๋ถ url์ ์์๋ก ์คํํ๋ฉด ๋ฆฌ์คํฌ๊ฐ ํฝ๋๋ค.
There was a problem hiding this comment.
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 ์ฃผ์ ์ผ๋ก ์คํด/๋๋ฉ์ธ ๊ฒ์ฆ ์ฑ ์ ๋ถ๋ฆฌ
- ์คํด๋ง ๋น ๋ฅด๊ฒ ๊ฒ์ฆ
๐ ์์ฝ
๐ ์์ ๋ด์ฉ
|
๐ ์์ฝ
๐ ์์ ๋ด์ฉ
FirebaseService
AndroidManifest
๐ก ํ ์คํธ ๋ฐฉ๋ฒ
โ ๊ถ๊ธ ์ฌํญ