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

[AN] feat: FCM 구현 #312

Merged
merged 16 commits into from
Aug 15, 2024
Merged

[AN] feat: FCM 구현 #312

merged 16 commits into from
Aug 15, 2024

Conversation

gaeun5744
Copy link
Member

이슈

개발 사항

  • FCM 구현

전달 사항 (없으면 삭제해 주세요)

@gaeun5744 gaeun5744 linked an issue Aug 6, 2024 that may be closed by this pull request
6 tasks
@gaeun5744 gaeun5744 self-assigned this Aug 6, 2024
@gaeun5744 gaeun5744 added 🤖 android android 📝 docs docs ✨ feat 기능 개발 and removed 📝 docs docs labels Aug 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

Test Results

3 tests  ±0   3 ✅ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit ea02fd4. ± Comparison against base commit bde5fec.

♻️ This comment has been updated with latest results.

Copy link
Member

@junjange junjange left a comment

Choose a reason for hiding this comment

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

FCM 구현하시느라 고생하셨습니다!! 코멘트 한번 확인해주세요!

Comment on lines 1 to 9
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>
}
Copy link
Member

Choose a reason for hiding this comment

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

이게 어떤 DataSource일까요?!
use case를 사용하는 곳이 없어서 어디서, 어떻게 쓰이는지 감이 안오네요ㅠ

Copy link
Member Author

Choose a reason for hiding this comment

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

다시 보니깐 네이밍이 모호하네요ㅠㅠ AlarmSetting으로 바꾸겠습니다!

Comment on lines 7 to 24
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()
}
}
Copy link
Member

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를 저장한다고 생각 할 것 같아요! 이 부분에서 혼동이 있을 수 있으므로, 네이밍을 명확히 하는 것이 중요합니다.

Copy link
Member Author

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(
Copy link
Member

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() {
Copy link
Member

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> =
Copy link
Member

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() {
Copy link
Member

Choose a reason for hiding this comment

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

굿굿! 고생하셨습니다!😊

jinuemong
jinuemong previously approved these changes Aug 7, 2024
Copy link
Contributor

@jinuemong jinuemong left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 ! !

@gaeun5744 gaeun5744 removed a link to an issue Aug 7, 2024
6 tasks
@ehtjsv2 ehtjsv2 closed this Aug 7, 2024
@ehtjsv2 ehtjsv2 deleted the feature/fcm branch August 7, 2024 02:44
@gaeun5744 gaeun5744 reopened this Aug 7, 2024
dpcks0509
dpcks0509 previously approved these changes Aug 8, 2024
Copy link
Contributor

@dpcks0509 dpcks0509 left a comment

Choose a reason for hiding this comment

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

고생하셨어요~~

dpcks0509
dpcks0509 previously approved these changes Aug 9, 2024
Copy link
Contributor

@dpcks0509 dpcks0509 left a comment

Choose a reason for hiding this comment

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

고생했어요~

Copy link
Contributor

@jinuemong jinuemong left a comment

Choose a reason for hiding this comment

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

확인 다했습니다~
복잡한 기능인데 고생하셨어요 !

@gaeun5744 gaeun5744 merged commit 193a7f1 into develop Aug 15, 2024
2 checks passed
takoyakimchi pushed a commit that referenced this pull request Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android android ✨ feat 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FCM 구현
5 participants