echo_salik
echo_salik

Reputation: 859

FCM Subscribe Topic return Invalid Token

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"
}

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

Upvotes: 2

Views: 2806

Answers (1)

Hisham Muneer
Hisham Muneer

Reputation: 8742

I believe you are hitting a GET request with topic subscribe, try POST with the same parameters.

Or you are hitting incorrect url: Hitting an url without ../rel/.. also produces the same error.

Error

Similar Error

Solution

Solution

Upvotes: 5

Related Questions