티스토리 뷰
2023.05.03 - [Android/Notification] - [ Notification #2 ] FCM Background Issue
[ Notification #2 ] FCM Background Issue
알림 배지 아이콘 숫자 컨트롤 하기 운영업무를 하고 있는 상황에서 특이한 요건이 들어와 기록 한다. 현재 운영중인 앱은 서버에서 내려오는 푸시와 로컬에서 생성하는 푸시 두가지가 존재 한
jihunstudy.tistory.com
서버에서 푸시를 보낼 때 특정 카운트 값을 담고 있는 데이터 필드를 사용해서
알림 아이콘 배지 카운트를 적용할때 사용 했다.
이 알림 아이콘 배지 카운트는 디바이스 회사 마다 처리 방식이 다르다고 한다.
그래서 나는 서드파티 라이브러리에 의존 하기로 했다.
https://github.com/leolin310148/ShortcutBadger
GitHub - leolin310148/ShortcutBadger: An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launc
An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launchers. - GitHub - leolin310148/ShortcutBadger: An Android library supports badge notification like iOS in Sa...
github.com
FirebaseMessagingService를 상속받은 클레스 안에 푸시를 받으면
override fun onMessageReceived(message: RemoteMessage)
안에서 Notification을 셋팅할때 같이 써주면 될듯
ShortcutBadger.applyCount(getApplicationContext, badgeCount)
ShortcutBadger.removeCount(getApplicationContext)
// 이건 혹시 몰라서 이것도 같이 써줌
val manager = getSystemService(FirebaseMessagingService.NOTIFICATION_SERVICE) as NotificationManager
manager.cancelAll()
-- 수정
이 라이브러리 쓸때 아래 글 꼭 참고하세요 .. 안그럼 큰일 납니다 ..
2023.05.04 - [Android/Notification] - [ Notification #4 ] ShortcutBadger 라이브러리에 대하여.. ( 개인적인 의견 )
[ Notification #4 ] ShortcutBadger 라이브러리에 대하여.. ( 개인적인 의견 )
아이콘 알림 배지 카운트를 컨트롤 하고자 해당 라이브러리를 사용했다. FCM Background 이슈로 인해서 업데이트가 잘 되지 않았던 문제도 notification 키를 제거 하므로서 해결 되긴 했으나, 요건이
jihunstudy.tistory.com
'Android > Notification' 카테고리의 다른 글
| [ Notification #4 ] ShortcutBadger 라이브러리에 대하여.. ( 개인적인 의견 ) (2) | 2023.05.04 |
|---|---|
| [ Notification #2 ] FCM Background Issue (0) | 2023.05.03 |
- Total
- Today
- Yesterday
- api key 관리
- flutter web
- github actions
- 웨어러블
- github secrets
- 테스트 앱 배포
- aos img url bitmap
- wear os
- firebase distribution
- widget 이미지 로딩
- Android
- 폴더블 상태 유지
- 폴더블 이벤트 받기
- local.properties
- widget glide
- 풀배열 키보드
- 안드로이드 폴드 대응
- 기름잡아주는
- 맥 전용
- 안드로이드 플립 대응
- widget 만들기
- github
- 쏘렌토 하이브리드
- android widget 만들기
- 갤럭시 워치
- widget onupdate
- 쏘렌토 하이브리드 시그니처
- widget onreceive
- 테스트 배포
- 오브제썬스틱
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |