FCM HTTP V1 API returns 404 for unregistered token

前端 未结 2 1242
失恋的感觉
失恋的感觉 2021-02-18 16:08

FCM HTTP v1 API supposed to return error code \"UNREGISTERED\" when device is unregistered (app uninstalled). However API returns 404 \"Requested entity was not found\".

相关标签:
2条回答
  • 2021-02-18 16:34

    Yes, I've experienced this with the firebase-admin-node module, which has been updated recently to map NOT_FOUND to an "unregistered" error, so it appears that it is an expected response.

    https://github.com/firebase/firebase-admin-node/commit/069c9cd50502b0fa7cc6843ea3ef9d8d85dca9b9#diff-ce3edf3ab3ed8957259b6bd4035a0256R617

    (Though it looks to be the status being NOT_FOUND is the key info rather than the "Requested entity was not found" message)

    One thing you may want to confirm is unregistered tokens from different browsers/devices. I.e., I think unregistered tokens from chrome returned a different error than one from firefox.

    0 讨论(0)
  • 2021-02-18 16:38

    We face error 404 error code when sending notifications to Unregistered Devices via the old FCM endpoint:

    https://fcm.googleapis.com/fcm/send
    

    The documentation for API v1 has been updated and and does not contain this error code.

    0 讨论(0)
提交回复
热议问题