-
Notifications
You must be signed in to change notification settings - Fork 3
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
[AN] feat: FCM 구현 #312
[AN] feat: FCM 구현 #312
Conversation
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.
FCM 구현하시느라 고생하셨습니다!! 코멘트 한번 확인해주세요!
package com.happy.friendogly.data.source | ||
|
||
interface SettingDataSource { | ||
suspend fun saveAlarm(isSet: Boolean): Result<Unit> | ||
|
||
suspend fun getAlarm(): Result<Boolean> | ||
|
||
suspend fun deleteAlarm(): Result<Unit> | ||
} |
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.
이게 어떤 DataSource일까요?!
use case를 사용하는 곳이 없어서 어디서, 어떻게 쓰이는지 감이 안오네요ㅠ
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.
다시 보니깐 네이밍이 모호하네요ㅠㅠ AlarmSetting
으로 바꾸겠습니다!
class AlarmTokenDataSourceImpl( | ||
private val alarmTokenModule: AlarmTokenModule, | ||
) : AlarmTokenDataSource { | ||
override suspend fun getToken(): Result<String> = | ||
runCatching { | ||
alarmTokenModule.token.first() | ||
} | ||
|
||
override suspend fun saveToken(token: String): Result<Unit> = | ||
runCatching { | ||
alarmTokenModule.saveToken(token) | ||
} | ||
|
||
override suspend fun deleteToken(): Result<Unit> = | ||
runCatching { | ||
alarmTokenModule.deleteToken() | ||
} | ||
} |
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.
여기서 token
은 아마 FCM Token
일 것 같은데, 일반적으로? 앱에서 token
을 저장한다고 하면 jwt
를 저장한다고 생각 할 것 같아요! 이 부분에서 혼동이 있을 수 있으므로, 네이밍을 명확히 하는 것이 중요합니다.
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.
이 부분에 대해 궁금한 점이 있습니다! 혹시 객체 내 프로퍼티 or 메서드 네이밍 때문에 헷갈렸던 경험이 있을까요..?
해당 메서드는 AlarmToken 객체 내에 있기 때문에 헷갈릴 여지가 없다고 생각했습니다!
예를 들어서... intent는 4대 컴포넌트 모두에서 필요한 객체임에도 불구하고, Activity 내에 있는 intent는 Activity의 intent구나! 라고 알아서 인식하는 느낌...?
++ 프리코스 피드백 안에, 객체 지향 생활 체조 원칙 인용 글에도 관련 내용이 있어요!
저 가끔 프리코스 피드백 보면서 다시 되짚는 편인데, 지금봐도 유익한거 같네요 헤헤 강추강추
import com.happy.friendogly.local.di.AlarmModule | ||
import kotlinx.coroutines.flow.first | ||
|
||
class SettingDataSourceImpl( |
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.
어떤 것을 setting
하는지 잘 모르겠어요!
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
|
||
class AlarmReceiver : FirebaseMessagingService() { |
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.
굿굿 고생하셨습니다!😊
|
||
private val key = stringPreferencesKey(FCM_TOKEN) | ||
|
||
var token: Flow<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.
아래 코멘트와 유사합니다!
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
|
||
class AlarmReceiver : FirebaseMessagingService() { |
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.
고생하셨습니다 ! !
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.
고생했어요~
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.
확인 다했습니다~
복잡한 기능인데 고생하셨어요 !
이슈
개발 사항
전달 사항 (없으면 삭제해 주세요)