Skip to content

[#678] 로그인 직후 FCM token 동기화 누락을 해결한다#684

Merged
opficdev merged 4 commits into
developfrom
fix/#678-fcm-token
Jul 3, 2026
Merged

[#678] 로그인 직후 FCM token 동기화 누락을 해결한다#684
opficdev merged 4 commits into
developfrom
fix/#678-fcm-token

Conversation

@opficdev

@opficdev opficdev commented Jul 3, 2026

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 의도

  • 로그인 직후 FCM token이 Firestore에 저장되지 않아 앱 재실행 전까지 푸시 발송 대상에서 누락될 수 있는 문제 해결
  • 로컬 hash 기준 중복 스킵보다 현재 기기 token을 서버에 바로 반영하는 동작 우선

📝 작업 내용

📌 요약

  • FCM token 동기화에서 UserDefaults 기반 hash 저장 및 조회 제거
  • foreground 복귀 시 알림 권한이 허용되어 있으면 APNs 등록을 다시 요청하는 경로 추가
  • APNs 등록 요청 lifecycle을 AppDelegate에서 내부 notification으로 변환하도록 조정
  • 푸시 알림 설정 footer에 기기 알림 권한과 알림 리스트 생성 정책 안내 추가
  • 잔여 Firebase REST integration test 파일 제거

🔍 상세

  • FCMTokenSyncHandler가 같은 FCM token이라도 sync 이벤트마다 updateFCMToken을 호출하도록 변경
  • didRequestAPNsRegistration 내부 notification 추가
  • AppDelegate.applicationWillEnterForeground에서 foreground 복귀 이벤트를 APNs 등록 요청으로 중계
  • foreground 복귀 시 FCM token을 직접 저장하지 않고 APNs 등록 요청만 수행하도록 분리
  • APNs token 수신 및 FCM token refresh callback을 통한 기존 저장 흐름 유지
  • 푸시 알림 설정 footer 문구에 기기 알림 권한을 꺼도 알림 리스트가 생성되는 정책 명시
  • 프로젝트에 참조가 남아 빌드를 방해하던 Firebase REST integration test 관련 파일 제거

📸 영상 / 이미지 (Optional)

@opficdev opficdev self-assigned this Jul 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes persistent caching of the FCM token hash from FCMTokenSyncHandler to fix synchronization issues, simplifies the token update logic, and adds APNs registration requests when the app enters the foreground. The review feedback recommends introducing an in-memory cache to prevent redundant token synchronization API calls during frequent foreground entries within the same session.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Application/App/Sources/App/Handler/FCMTokenSyncHandler.swift
Comment thread Application/App/Sources/App/Handler/FCMTokenSyncHandler.swift
Comment thread Application/App/Sources/App/Handler/FCMTokenSyncHandler.swift
@opficdev opficdev merged commit a476a8d into develop Jul 3, 2026
6 checks passed
@opficdev opficdev deleted the fix/#678-fcm-token branch July 3, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

로그인 직후 FCM token이 Firestore에 저장되지 않는 현상을 해결한다

1 participant