-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor/#461 alarm #467
Refactor/#461 alarm #467
Conversation
Test Results43 testsโ ยฑ0โโโ43 โ๏ธ ยฑ0โโโ0s โฑ๏ธ ยฑ0s Results for commit 6271e55.โยฑ Comparison against base commit f9823ac. โป๏ธ This comment has been updated with latest results. |
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.
์๋
ํ์ธ์ ์ฝ๋น! :)
ํจ์ ๋ถ๋ฆฌ๊ฐ ๋๋ ๋ณด๊ธฐ ๋ ํธํด์ ธ์ ์ข๋ค์ :)
๋ค๋ง,
์ฑ์ ์คํ ์ค์ธ ์ํ์์, ๊ฒ์๊ธ A์ B ์์๋๋ก ์ถ์ฒ ๋ฐ์์ ๋จ๊ธฐ๋ฉด ์๋ ๋ ๊ฐ๊ฐ ์์
์ด ์๋ ๋ ๊ฐ๋ฅผ ๋๋ฌ๋ณด๋ฉด ๋ ๋ค ๊ฒ์๊ธ B๋ก ์ด๋ํฉ๋๋ค.
์ฝ๋น๋ ์ด ๋ถ๋ถ ํ ๋ฒ ํ
์คํธํด๋ณด์๊ณ ํ์ธํด์ฃผ์๋ฉด ์ข๊ฒ ๋ค์ :)
(์ ๋ API 33 ๋ฒ์ ์์ ํ
์คํธ ์งํํ์ต๋๋ค)
+) ์ฌ๋ ๋ฒ๊ทธ์ ๋ณด
์ ๋จ๊ฒจ๋๋ฆฐ ์ฒดํฌ๋ฆฌ์คํธ๋ฅผ ํ ๋ฒ์ฉ ํ์ธํด๋ณด๋ฉด์ ๋ฒ๊ทธ ์ฒดํฌํด๋ณด๋ฉด ์ข๊ฒ ๋ค์!
์ด ๋ถ๋ถ์ ๋ง๋์ ๊ฐ์ด ํด๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค ;)
@@ -20,7 +20,6 @@ import kotlinx.coroutines.CoroutineScope | |||
import kotlinx.coroutines.Dispatchers | |||
import kotlinx.coroutines.launch | |||
|
|||
// TODO("Notification ๋ถ๋ฆฌ ์์ ") | |||
class AlarmService : FirebaseMessagingService() { | |||
override fun onNewToken(token: String) { | |||
super.onNewToken(token) |
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.
onNewToken
์ override ํด์ค ์ด์ ๋ ๋ฌด์์ธ๊ฐ์?
@@ -29,7 +30,9 @@ class LoginViewModel(private val repository: AuthRepository) : | |||
} | |||
|
|||
private fun login(email: String, password: String) { | |||
Log.d("this", "1") |
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.
์ ์ฐ๋ ๋ก๊ทธ๋ ์ญ์ ํด์ฃผ์ธ์ :)
|
||
val pendingIntent = PendingIntent.getActivity( | ||
this, | ||
0, |
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.
0, | |
System.currentTimeMillis().toInt(), |
requestCode
๊ฐ ๋์ผํ ๊ฒฝ์ฐ์๋ ๋ง์ง๋ง PendingIntent ๋ก ์นํ๋ฉ๋๋ค.
๊ทธ๋์ ์ ๊ฐ ์ดํดํ ๋ฐ๋ก๋, pendingIntent์ ๋ค์ด๊ฐ๋ requestCode
๋ ๋ค๋ฅธ PendingIntent์ ๊ตฌ๋ณํ๊ธฐ ์ํด ์ฌ์ฉ๋๋,
๋ง์น ๊ณ ์ ๊ฐ
๊ณผ ๊ฐ์ ๊ฐ๋
์ธ ๊ฒ ๊ฐ์์.
๊ทธ๋์ requestCode
์ ๋ค๋ฅธ ๊ฐ์ด ๋ค์ด๊ฐ๋๋ก ํ์ฌ ๊ตฌ๋ถ์ ์ง์ด๋ณด๋,
๋ฆฌ๋ทฐ์ ๋จ๊ฒจ๋๋ ธ๋ ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋๋ ๊ฒ ๊ฐ์์.
(์ฝ๋น์ ํ๊ฒฝ์์๋ ์ ๋์ํ๋์ง ํ
์คํธ ํ ๋ฒ ํด์ฃผ์ธ์!)
requestCode๋ฅผ ์ ๋ ๋ค์๊ณผ ๊ฐ์ด ์ฝ๋ ์์ ์ ์ ์๋๋ ธ๋๋ฐ,
์ฃผ ์์ ์ requestCode๊ฐ ๋ค๋ฅด๊ฒ ํ์ฌ pendingIntent๊ฐ ๊ตฌ๋ถ๋์ด ์ค๋๋ก ํ๋ ๊ฒ์ด๋ ๋ ๋์ ๋ฐฉ๋ฒ์ด ์๋ค๋ฉด ๊ทธ ๋ฐฉ๋ฒ๋๋ก ํด์ฃผ์
๋ ๋ฉ๋๋ค!
ref.
https://stackoverflow.com/questions/21526319/whats-requestcode-used-for-on-pendingintent
https://devmingsa.tistory.com/11
https://iw90.tistory.com/221
์์ ๋๊ฑฐ ํ์ธํ์ต๋๋ค. notificationId๋ฅผ ์ฐ๋ ๋ ์ง๊ด์ ์ด๊ณ ์ข์ ๊ฒ ๊ฐ์์!! ๊ตฟ๊ตฟ ์ดํธ๋ฃจ๋ธ ํ ๊ฒ์ ~~ |
๐ฅ ์ฐ๊ด ์ด์
๐ ์์ ์์ฝ
์๋ ํฌ๊ทธ๋ผ์ด๋ ๋ฒ๊ทธ ์์ ๋ฐ ํจ์ ๋ถ๋ฆฌ
๐ ์์ ์์ธ ์ค๋ช
๐ ๋ฆฌ๋ทฐ ์๊ตฌ ์ฌํญ