Adel Benyahia
1 min readNov 4, 2022

Thanks for your explanation , you did a nice work on how to implement firebase notifications, but
As we can read on the official documentation:
"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 ..."
We have to implement a validation mechanism to delete invalid token
"Detect invalid token responses from the FCM backend
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)
See ErrorCodes for more information.

If you receive either of these responses for a targeted token, it is safe to delete your record of this token, since it will never again be valid."

Adel Benyahia

Web application developer (HTML │ CSS │ JS | ReactJS | NextJS | NestJS | MERN)