首页 > 解决方案 > 使用 Ruby 的 Firebase 云消息传递显示无效令牌

问题描述

让服务器运行几个小时后,云消息传递开始返回以下内容(下面的截断响应)。

{:body=>"{\"error\":\"InvalidToken\"}", :response=>"Only applies for JSON requests. Indicates that the request could not be parsed as JSON, or it contained invalid fields."}

一旦我重新启动 Apache 并尝试重新发送 Firebase Cloud 消息,它将成功发送。

{:body=>"{\"message_id\":4439418067666362930}", :status_code=>200, :response=>"success"}

我知道令牌是有效的,因为它会在 apache 重新启动后正确发送。我正在使用带有 FCM gem 0.0.6 的 Ruby Rails

fcm (0.0.6)

标签: ruby-on-railsfirebasefirebase-cloud-messaging

解决方案


推荐阅读