FCM Token 이 똑같은 문제

apwierk·2023년 11월 8일
1

오류 해결

목록 보기
3/9

fcmToken을 서버에 등록하는 과정에서 앱 최초 설치 후 실행할 경우에만 알림이 오는 문제 발견

func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
	print(fcmToken)
}

해당 문제를 파악하기 위해 fcmToken 로그를 확인했는데, 앱을 삭제하고 다시 설치해도 계속 같은 토큰 값이 나오는 문제 발생

FCM Token이 변경되지 않음.

firebase 설정 문제라고 판단하여 한참을 찾았지만, 이유는 info.plist

[FirebaseMessaging][I-FCM001000] 
FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers.
If you'd prefer to manually integrate Firebase Messaging,
add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO.
Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.

해당 로그가 계속 발생하길래 없애기 위해 info.plist에 FirebaseAppDelegateProxyEnabled = NO로 설정해둔 것이 문제였다. swizzling = enable 상태이어야만 앱 재설치 시 토큰 값이 새로고침 되는 것으로 확인

참고 블로그

profile
iOS 꿈나무 개발자

0개의 댓글