Skip to content

Conversation

@leeeyubin
Copy link
Member

@leeeyubin leeeyubin commented Apr 28, 2025

⛳️ Work Description

  • Payload 형식 수정
  • 푸시알림에 LargeIcon 추가
  • 알림 유형별 분기처리
  • 포그라운드 상태일 때 분기처리

📸 Screenshot

LargeIcon 적용 사진
처음 알림 클릭 시
(탐색으로 가는 알림)
포그라운드 상태에서 알림 클릭 시
(홈으로 가는 알림)
Screen_Recording_20250429_014720_One.UI.Home.mp4
Screen_Recording_20250429_014938_One.UI.Home.mp4

📢 To Reviewers

  • 드디어 길고 길었던 푸시알림 구현이 끝났습니다!🥹
  • 알림을 클릭했을 때 무조건 스플래쉬를 거치는 것은 맞지만, 앱이 활성화 되어있는 상태(포그라운드)일 때는 바로 그 화면으로 이동하도록 했어요!
  • 이를 구현하면서 앱의 진입점(startDestination)을 매번 바꾸는 방향으로 수정했습니다! (아린언니 보고 참고해주세요!)
  • 고려하지 않게 된 두 가지 사항에 대해서도 이유를 작성해보겠습니당
    1. 업데이트 확인하기(포그라운드) : 알림 자체를 처음 눌렀을 때는 스플래쉬를 거치기 때문에, 굳이 사용자가 앱을 쓰고 있을 때 업데이트가 일어나는 경우는 고려할 필요가 없다고 판단.
    2. 토큰 유무 확인하기 : 알림을 받기 위해서는 alarmAvailable을 설정해줘야하는데, 로그인이 안 된 상태는 무조건 alarmAvailable이 false임. 그래서 알림을 받을 케이스가 없음

@leeeyubin leeeyubin added FEAT ✨ 새로운 기능 구현 유빈💙 유빈 labels Apr 28, 2025
@leeeyubin leeeyubin added this to the 4차 스프린트 작업 milestone Apr 28, 2025
@leeeyubin leeeyubin self-assigned this Apr 28, 2025
Copy link
Member

@boiledeggg boiledeggg left a comment

Choose a reason for hiding this comment

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

로직이 상당히 복잡하네요😵 4차 스프린트 동안 너무 고생많았어유~~!!

Comment on lines 140 to 143
return appProcesses?.any {
it.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
it.processName == packageName
} == true
Copy link
Member

Choose a reason for hiding this comment

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

조건들을 변수로 선언해두면 코드 가독성이 지금보다 좋아질 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

반영했습니다! 가독성이 좋아진 것 같네요:)

Comment on lines 60 to 65
val systemUiController = rememberSystemUiController()

LaunchedEffect(Unit) {
systemUiController.setStatusBarColor(color = White)
systemUiController.setNavigationBarColor(color = White)
}
Copy link
Member

Choose a reason for hiding this comment

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

이걸 모든 화면에 선언해준 이유는 뭔가요? 안드로이드 API 때문인가요??

Copy link
Member Author

Choose a reason for hiding this comment

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

이 코드는 상태바와 네비게이션바의 색상을 지정해주는 코드에요!

더 이상 앱의 진입부분이 홈 화면만이 아니게 되면서 다른 진입 화면들도 색상을 정의해줘야되더라구요
위 코드가 없으면 아래와 같은 현상이 발생했습니다..

Copy link
Member

Choose a reason for hiding this comment

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

redirect하면 splash를 거치지 않고 바로 진입하는건가요?!?? splash 통해서 이동하는 로직이면 onDispose 내부에서 white로 다시 바꿔줘도 되지 않을까 싶어서요!(테스트는 안해봐서 될지는 모르겠어잉ㅎㅎ)

Copy link
Member Author

Choose a reason for hiding this comment

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

헉 왜 그 생각을 못했을까요!! 잘 됩니당~! 좋은 의견 감사해요!🚀🚀

보충 설명하자면 redirect는 Splash를 거친 후 리다이렉트 할 화면을 의미합니다!

Comment on lines 166 to 169
navOptions = NavOptions.Builder().setPopUpTo(
route = Splash(redirect),
inclusive = true
).build()
Copy link
Member

Choose a reason for hiding this comment

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

리다이렉트 관련된 화면들의 navOption들이 전부 동일한 것 같은데 하나로 통일해버리는건 어떤가요??

Copy link
Member Author

Choose a reason for hiding this comment

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

하나로 통일한다는 건 확장함수로 만들어서 적용하는 걸 의미하는 걸까요..?!

Copy link
Member

Choose a reason for hiding this comment

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

각각 다른 객체를 만들어 넘겨줄 필요 없이 변수 하나 만들어두고 사용하면 되지 않을까 싶어요!

Copy link
Member Author

Choose a reason for hiding this comment

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

이해했습니다!! 반영했어요! 역시 가독성의 신 석준오빠..🚀🚀

Copy link
Member

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

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

으아 진짜 어렵네요.. 우리 리드 짱이다 멋있다 최고다🚀🚀

Comment on lines 60 to 65
val systemUiController = rememberSystemUiController()

LaunchedEffect(Unit) {
systemUiController.setStatusBarColor(color = White)
systemUiController.setNavigationBarColor(color = White)
}
Copy link
Member

Choose a reason for hiding this comment

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

redirect하면 splash를 거치지 않고 바로 진입하는건가요?!?? splash 통해서 이동하는 로직이면 onDispose 내부에서 white로 다시 바꿔줘도 되지 않을까 싶어서요!(테스트는 안해봐서 될지는 모르겠어잉ㅎㅎ)

@leeeyubin leeeyubin merged commit 5df3ce7 into develop Apr 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FEAT ✨ 새로운 기능 구현 유빈💙 유빈

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] FCM 푸시알림 커스텀 / Payload 형식에 맞게 구현

4 participants