-
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
[Feature/#68] : fcm, like api #72
Conversation
โฆinto feature/#68-fcm-like-api
โฆBLE-ANDROID into feature/#68-fcm-like-api
โฆinto feature/#68-fcm-like-api
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.
@@ -29,6 +29,7 @@ interface ProfileService { | |||
@PATCH("api/v1/withdrawal") | |||
suspend fun patchWithdrawal(@Body requestWithdrawalDto: RequestWithdrawalDto): BaseUnitResponse<Unit> | |||
|
|||
@Multipart |
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.
P3 : ์! ํท
@@ -159,4 +174,44 @@ class HomeFragment : BindingFragment<FragmentHomeBinding>(FragmentHomeBinding::i | |||
if (isUploaded) scrollToTop() | |||
} | |||
} | |||
|
|||
private val requestPermission = registerForActivityResult( |
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.
P3 : ๋ค ํฉ์น๊ณ ์๋ฆผ๋ ๊ฐค๋ฌ๋ฆฌ์ ๊ฐ์ด ์ฒจ ์์ํ ๋ ๋ฐ์๊ฑด๊ฐ์?
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.
๊ฐค๋ฌ๋ฆฌ ๋์๋ ์จ๋ณด๋ฉ ์ค ํ๋กํ ์ค์ ๋ทฐ์์ ๋ฐ๊ณ , ํธ์ ์๋ฆผ ๋์๋ ํ์์ ๋ฐ๊ธฐ๋ก ํ์ต๋๋ค! (๊ธฐํ ์์ฒญ)
toast("like") | ||
override fun onLikeBtnClick(viewHolder: FeedViewHolder, id: Long, isLiked: Boolean) { | ||
feedActionHandler.onLikeBtnClick(viewHolder, id) { feedId, likeState -> | ||
singleEventHandler.debounce(coroutineScope = lifecycleScope) { |
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.
P3 : debounce ๋ง๊ณ throttle๋ ์ด๋์?
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.
debounce์ throttle์ ์ฐจ์ด์ ์ throttle์ ์ ์ด๋ n ๋ฐ๋ฆฌ ์ด๋ง๋ค ์ ๊ธฐ์ ์ผ๋ก ๊ธฐ๋ฅ ์คํ์ ๋ณด์ฅํ๋ค๋ ์ ์
๋๋ค!
๋๋ฐ์ด์ค๋ ์๋ฌด๋ฆฌ ๋ง์ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํด๋ ๋ชจ๋ ๋ฌด์ํ๊ณ ํน์ ์๊ฐ์ฌ์ด์ ์ด๋ค ์ด๋ฒคํธ๋ ๋ฐ์ํ์ง ์์์ ๋ ๋ฑ ํ๋ฒ๋ง ๋ง์ง๋ง ์ด๋ฒคํธ๋ฅผ ๋ฐ์์ํค๋ ๊ธฐ๋ฒ์ด๊ตฌ์!
throttle์ ์ด๋ค๋ฉด ์ข์์๋ฅผ ์ฐ์ํด์ ๋๋ฅด๋ ํ์๋ฅผ ์์ ํ ๋ง๊ธฐ ๋ณด๋ค๋ api ํธ์ถ์ ์ค์ฌ์ค๋ค๋ ํํ์ด ๋ง์ ๊ฒ ๊ฐ๋ค์! throttle์ ์ผ์ ์๊ฐ๋ง๋ค ์์ฒญ์ ๋ณด๋ด๋ฏ๋ก ์ฌ๋ฌ๋ฒ ํด๋ฆญ ์ ๊ทธ ๊ฐ๊ฒฉ์ ๋ฐ๋ผ ์์ฒญ์ด ๋ฐ์ํ ์ ๋ ์์ต๋๋ค ๊ทธ๋์ debounce๋ก ๊ตฌํํ์ต๋๋น
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.
๊น๋จน์ ใ ใ
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.
์ฒ์ฌ ๊ฐ๋ฐ์์ ๊ฐ๋ฏธ์น์ฝ๋ ์๋ณด๊ณ ๊ฐ๋๋ค ๐ฅ
implementation(libs.google.play.services) | ||
implementation(libs.firebase.messaging.ktx) |
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.
ํน์ ์ด๊ฑฐ ์ต์ ๋ฒ์ ์์ ๋์๊ฐ๋์? zํ๋ฆฝ6์์ fcm์์ค๊ธธ๋ ๋ฒ์ ์
ํ๋๊น ์ค๊ธด ํ์ต๋๋ค
์ ๋ ์ ํํ ์์ธ์ ๋ชจ๋ฅด๊ฒ ์ด์ใ
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.
์์ง ํธ์์๋ฆผ ์๋ ๊ฑฐ์์ ใ .ใ ์์ ์ค ใ ใ ๋ค์ PR์์ ์์ ํ๊ฒ ์ต๋๋ค-!!
<meta-data | ||
android:name="com.google.firebase.messaging.default_notification_color" | ||
android:resource="@color/white" /> |
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.
์ด๋ฒ์ meta data์ icon์ถ๊ฐ ์ ํด๋ ๋๋์?
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.
์ถ๊ฐํด์ผํฉ๋๋ค!!! ์์ ํ๋ค๊ฐ ๋นผ๋๊ณ ์ถ๊ฐ ์ํ๋ค์ ..ใ ใ
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.
๊ทธ๋๋ก ๋ณต๋ถํ๋๋ฐ ๋์๊ฐ๋ ๋ฏธ์น์ฝ๋ ๐ ๐ ๐
} | ||
|
||
viewHolder.likeCountTv.text = updatedLikeCount.toString() | ||
saveLike(id, LikeState(viewHolder.likeBtn.isChecked, updatedLikeCount.toString())) |
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.
์ฐ์..
likeFeedsFlow.value = likeFeedsFlow.value.toMutableMap().apply { | ||
put(feedId, likeState) | ||
} |
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.
likeFeedsFlow.value = likeFeedsFlow.value.toMutableMap().apply { | |
put(feedId, likeState) | |
} | |
likeFeedsFlow.update { currentMap -> | |
currentMap.toMutableMap().apply { | |
put(feedId, likeState) | |
} | |
} |
๋ง์ฝ likeFeedsFlow ์ฌ๋ฌ๊ตฐ๋ฐ์ ์ ๊ทผ์ด ๋๋ค๋ฉด update ํจ์๋ฅผ ํตํด ์ค๋ ๋ ์์ ์ฑ์ ์ค ์ ์๋ค๊ณ ํฉ๋๋ค!
์ฌ์ค ํฐ ์ฐจ์ด๋ ๋ชจ๋ฅด๊ฒ ๋๋ฐ ์ ๋ ๊ฐ ๋ณํ ๋ง์ ๊ณณ๋ค์ ์ด๋ฒ์ upate์ฌ์ฉํด ๋ณด์์ด์
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.
์ค!!!! ์ ๋ง ์ข์ ์ง์์ด๋ค์!! ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค-! ๋ฉ์ง๋ค์
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.
๋ฐ์ํ์ต๋๋ค! 25bcd3a
.filter { removedCommentIds.contains(it.commentId).not() } | ||
.map { data -> | ||
val likeState = likeStates[data.commentId] ?: LikeState(data.isLiked, data.likedNumber) | ||
val transformedGhost = if (ghostedUserIds.contains(data.postAuthorId)) data.copy(isPostAuthorGhost = true) else data | ||
transformedGhost.copy(likedNumber = likeState.count, isLiked = likeState.isLiked) | ||
} |
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.
๋์ค์ ์๊ธด usecase๋ก ๋บ์๋ ์์๊ฒ ๊ฐ์์!
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.
๋ ์ข์์! ์๋ ์ usecase ์ธ ๋๋ ํ์์ฑ์ ์ ๋ชฐ๋๋๋ฐ, ์์ฆ wableํ๋ฉด์ ํ์์ฑ์ ๋๋ฌด ๋๋ผ๊ณ ์์ต๋๋ค ใ
ใ
ใ
ใ
ใ
๋ค์ ์คํ๋ฆฐํธ ๋ ๋์
ํด๋ด์ ~!
FCM์ ๋ค์ pr์์ ์๋ฃํ๊ฒ ์ต๋๋ค~! |
โ ๐๐ต๐ฒ๐ฐ๐ธ-๐๐ถ๐๐
๐ ๐๐๐๐๐ฒ๐
๐๐ช๐ผ๐ฟ๐ธ ๐๐ฒ๐๐ฐ๐ฟ๐ถ๐ฝ๐๐ถ๐ผ๐ป
๐ท ๐ฆ๐ฐ๐ฟ๐ฒ๐ฒ๐ป๐๐ต๐ผ๐
์ข์์
20240905_174735.mp4
๋ต๊ธ ์์ฑ ์๋ฃ์
scroll.webm
๐ฌ ๐ง๐ผ ๐ฅ๐ฒ๐๐ถ๐ฒ๐๐ฒ๐ฟ๐