Skip to content

[FIX] 동일 기기 여러 계정 푸시 알림 처리 #294

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

Merged
merged 8 commits into from
Feb 11, 2025
Merged

Conversation

ChaeAg
Copy link
Member

@ChaeAg ChaeAg commented Feb 8, 2025

Related Issue

Key Changes

현재 로직에서는 유저가 로그아웃 해도 저장되어 있던 유저의 devices 정보를 삭제하지 않습니다.
그러다보니, 유저1이 로그아웃 후 유저2로 접속 시 유저1의 devices와 유저2의 devices가 같기 때문에 유저2는 자신의 알람과 유저1의 알림까지 함께 받게 됩니다.
하여, 유저가 로그아웃 할 때 해당 기기의 디바이스 값을 삭제하고 유저 로그인 시 매번 새로운 fcm token을 발급받는 방식으로 해당 상황을 해결했습니다.

주요 변경사항

  1. 유저 로그아웃 API 변경
    • Request에 디바이스고유값(deviceIdentefier) 컬럼 추가
    • 로그아웃 시 유저의 디바이스 값 제거 로직 추가
  2. FCM token 등록 API 변경
    • 유저를 기준으로 기존 저장된 FCM token이 존재하는지 조회하던 것을 유저와 디바이스값으로 기준 변경
  3. 푸시 알림 발송 로직 수정
    • 알림 대상 유저로 저장된 디바이스 값이 없다면 푸시 알림 발송하지 않도록 수정
  • 클라에게 로그인 시마다 fcm toekn 저장 API 호출 요청해야 합니다.

To Reviewers

References

@ChaeAg ChaeAg changed the title [FIX] 동일 기기 여러 계정 사용 시 푸시 알림 처리 [FIX] 동일 기기 여러 계정 푸시 알림 처리 Feb 8, 2025
Copy link
Member

@rinarina0429 rinarina0429 left a comment

Choose a reason for hiding this comment

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

로그아웃 시 유저의 디바이스 정보가 삭제가 안돼서 그랬던거군요! 빠른 캐치,, 디코와 함께 확인했습니다 수고하셨어요오

@ChaeAg ChaeAg merged commit abad526 into dev Feb 11, 2025
2 checks passed
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.

[FIX] 동일 기기 다른 계정 접속 시 푸시 알림 처리
2 participants