我正在使用通过firebase.messaging() . getToken()获取的FCM令牌,但firebase函数在发送消息时抛出错误 .

Invalid registration token provided. Make sure it matches the registration token the client app receives from registering with FCM. 我交叉检查了fcmToken三次,这是客户端firebase sdk返回的 . 有什么线索有什么不对吗?

当我尝试使用CURL发送消息时,我收到 NotRegistered 错误 .

{ "multicast_id": xxxxxxxxxxxxxxxxxxx, "success": 0, "failure": 1, "canonical_ids": 0, "results": [ { "error": "NotRegistered" } ] }

所以这就是我为重现这个问题所做的工作......

  • 我接受了在浏览器中接收通知的请求

  • 我也收到了一些通知

  • 我从Chrome设置中删除了审批

  • 我刷新了页面并再次接受了请求 .

  • 我获得了与之前相同的FCM令牌

  • 现在我没有收到任何消息 .