FCM Subscribe Topic return Invalid Token

ech*_*lik 2 curl firebase firebase-cloud-messaging

The problem is as stated above. If I try to subscribe to a push notification via the url: https://iid.googleapis.com/iid/v1/{token}/rel/topics/{topic}, I always get the following response: {"error":"InvalidToken"}

I have tried using both GET and POST methods but still the same response.

I have checked if the Token is a valid token by using the following url: https://iid.googleapis.com/iid/info/{token} which return the correct data like this:

{
    "application": "com.chrome.windows",
    "subtype": "wp:http://localhost/#2A58747F-DEF7-4C55-8073-126B2D168-V2",
    "authorizedEntity": "856365479457",
    "platform": "WEBPUSH"
}
Run Code Online (Sandbox Code Playgroud)

If my token is valid, then why I am getting the error invalid token?

His*_*eer 5

我相信您正在使用GET主题订阅发出请求,请尝试POST使用相同的参数。

或者您点击了不正确的网址:点击没有的网址../rel/..也会产生相同的错误。

错误

类似错误

解决方案

解决方案