티스토리 뷰
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
- Dot indicator
- github secrets
- 안드로이드 폴드 대응
- Android
- 쏘렌토 하이브리드 시그니처
- firebase distribution
- widget glide
- github actions
- Foldable Event
- 웨어러블
- aos img url bitmap
- 테스트 앱 배포
- widget onupdate
- 안드로이드 플립 대응
- 폴더블 상태 유지
- api key 관리
- 풀배열 키보드
- widget 만들기
- 폴더블 이벤트 받기
- widget onreceive
- flutter web
- github
- 쏘렌토 하이브리드
- widget 이미지 로딩
- local.properties
- 테스트 배포
- 갤럭시 워치
- 맥 전용
- android widget 만들기
- wear os
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |