I am using WebPush
in my project and it works well for the most part. However, occasionally - often after a prolonged period of use - a user will receive a 404 error with the following JSON response:
{
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND",
"details": [
{
"@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "UNREGISTERED"
}
]
}
}
What appears to be happening is that the token is expiring. The function onTokenRefresh()
is cited on numerous occasions, but with little documentation on how to implement and certainly none regarding how to test. Some users have reported clearing cache will force a token refresh; this is not the case for me.
I have had this problem for nearly 6 months, and regularly check back to see if the documentation has improved, but there is no clear solution to this problem.
Any solutions to test at this point would be enormously appreciated. I am sure there are others out there using the under-documented WebPush
notifications with similar issues.