Closed pcnetsoft-projects closed 8 years ago
Looks like you didn't replace the GCM API key with your own key.
Check this out: https://github.com/ToothlessGear/node-gcm/issues/151
It's solved.
I didn't change anything, but it's need more time to be activated in Google.
Thanks for letting us know what caused the problem -- good to know if anyone encounters this in the future :smile:
The problem is back to me, I don't know why, and i need to solve it .
You can check this example(Real API and token key) https://tonicdev.com/5712577524d46e1200acede5/571a677d05a61111000d0e0d
What kind of API key are you creating in the Google APIs Console?
Server key? Browser key?
I used the Server Key. I'm building APIs for my own Android application, and using Nodejs/Express for that.
Please try creating and using a Browser Key without any referrer restrictions to see if the 401 error goes away.
As far as I can tell using a server key should be fine. 401 is returned directly from GCM, which states that it is an error with authentication of the sender account. It sounds like you are either passing a wrong key (copied incorrectly, or similar).
I recall having an issue when GCM was first released, during the first week, that only a browser key would work for some reason. It is definitely a shot in the dark, though.
Any news, @pcnetsoft-projects ?
Closed due to lack of response.
Hello Team,
Sorry for the late, it was an emergency issues. Now, It's working with me when I changed the key to 'Browser Key'.
Thanks guys.
And I hope so that you can give me more details about the Error, not the status number only, we need a message or something like that to explain whats the error.
Good job :)
i can solve it by replace Browser key to server key(now using)
There are two keys in https://console.firebase.google.com/project/projectId
Got it working with Legacy server key
You can only Legacy server key "Server key (auto created by Google Service)" listed in https://console.cloud.google.com/apis/credentials?project=projectId
I tried to solve this problem, and i have been read the other issues, but didn't slove
I got 401 error:
`var gcm = require('node-gcm');