Skip to content
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

Handling Invalid Token responses #92

Open
excid3 opened this issue Dec 30, 2021 · 2 comments
Open

Handling Invalid Token responses #92

excid3 opened this issue Dec 30, 2021 · 2 comments

Comments

@excid3
Copy link
Contributor

excid3 commented Dec 30, 2021

Hey there! I'm new to FCM, but I was curious are these the two responses we should be using to remove tokens when they're invalid?

Make sure to detect invalid token responses from FCM and respond by deleting from your system any registration tokens that are known to be invalid. With the HTTP v1 API, these error messages may indicate that your send request targeted stale or invalid tokens:

  • UNREGISTERED (HTTP 404)
  • INVALID_ARGUMENT (HTTP 400)

https://firebase.google.com/docs/cloud-messaging/manage-tokens#detect-invalid-token-responses-from-the-fcm-backend

If that's correct, I'd be happy to add an example to the readme for anyone else new to this. 👍

@sabman
Copy link
Member

sabman commented Dec 30, 2021

Seems correct to me based on the documentation. Can someone else who is using fcm in production also confirm this?

@exarus
Copy link

exarus commented Mar 25, 2022

@sabman I wonder how does these match the codes described here: https://firebase.google.com/docs/cloud-messaging/send-message#admin

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

No branches or pull requests

3 participants