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

Refactor/#461 alarm #467

Merged
merged 4 commits into from
Oct 18, 2023
Merged

Refactor/#461 alarm #467

merged 4 commits into from
Oct 18, 2023

Conversation

rhkrwngud445
Copy link
Collaborator

๐Ÿ”ฅ ์—ฐ๊ด€ ์ด์Šˆ

๐Ÿ“ ์ž‘์—… ์š”์•ฝ

์•Œ๋žŒ ํฌ๊ทธ๋ผ์šด๋“œ ๋ฒ„๊ทธ ์ˆ˜์ • ๋ฐ ํ•จ์ˆ˜ ๋ถ„๋ฆฌ

๐Ÿ”Ž ์ž‘์—… ์ƒ์„ธ ์„ค๋ช…

๐ŸŒŸ ๋ฆฌ๋ทฐ ์š”๊ตฌ ์‚ฌํ•ญ

5๋ถ„์ด๋ฉด ์ถฉ๋ถ„ํ•ฉ๋‹ˆ๋‹ค

@github-actions
Copy link

github-actions bot commented Sep 27, 2023

Test Results

43 testsโ€‚ ยฑ0โ€‚โ€ƒโ€ƒ43 โœ”๏ธ ยฑ0โ€‚โ€ƒโ€ƒ0s โฑ๏ธ ยฑ0s
โŸโ€„8 suites ยฑ0โ€‚โ€ƒโ€ƒโŸโ€„0 ๐Ÿ’ค ยฑ0โ€‚
โŸโ€„8 filesโ€„โ€‚ ยฑ0โ€‚โ€ƒโ€ƒโŸโ€„0 โŒ ยฑ0โ€‚

Results for commit 6271e55.โ€ƒยฑ Comparison against base commit f9823ac.

โ™ป๏ธ This comment has been updated with latest results.

@sujin9 sujin9 changed the title Refactor 461 alarm Refactor/#461 alarm Sep 30, 2023
Copy link
Collaborator

@sujin9 sujin9 left a 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)
Copy link
Collaborator

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")
Copy link
Collaborator

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,
Copy link
Collaborator

@sujin9 sujin9 Sep 30, 2023

Choose a reason for hiding this comment

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

Suggested change
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

@sujin9
Copy link
Collaborator

sujin9 commented Oct 17, 2023

์ˆ˜์ •๋œ๊ฑฐ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค. notificationId๋ฅผ ์“ฐ๋‹ˆ ๋” ์ง๊ด€์ ์ด๊ณ  ์ข‹์€ ๊ฒƒ ๊ฐ™์•„์š”!! ๊ตฟ๊ตฟ ์–ดํ‘ธ๋ฃจ๋ธŒ ํ• ๊ฒŒ์š” ~~
์•ˆ์“ฐ๋Š” ๋กœ๊ทธ๋“ค์€ ์ œ๊ฐ€ ์‚ญ์ œํ–‡์„œ์šฅ !

@rhkrwngud445 rhkrwngud445 merged commit aae58e6 into dev Oct 18, 2023
@rhkrwngud445 rhkrwngud445 deleted the refactor_461_alarm branch October 18, 2023 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants