-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Client Error #228
Comments
Hey @rumkin, My first guess would be that you passed an invalid API key in the following line:
|
My API key was working during this morning before nodejs version update from 5.4 to 5.10. I'm sending pushes with this code: this.gcm = new gcm.Sender('YOUR_API_KEY_HERE'); // ...with proper API key
// ....
var message = new gcm.Message();
message.addData({
text: text,
sound: sound,
badge: badge,
params: JSON.stringify(data)
});
this.gcm.send(message, {registrationIds: [token]}, function (error) {
if (error) {
console.error(error);
}
}); |
@hypesystem any ideas? |
No idea, no... |
From a similar issue:
Could this be the problem? According to this issue from request, which we use underlying, it can happen when URLs contain invalid characters. The fix is calling The error is thrown, and not propagated properly. It seems that this can be fixed by updating the request version we use. |
Interesting theory! Would love to verify it -- @rumkin, can you add the following code to Find in
Add below:
Then, try to send a push notification and paste the headers here, please. |
Nope.
But there is a error object which content is equal to the first comment's error. |
Looks like you're using an outdated version of node-gcm. Line 109: Line 109 in c00e43f
Which version are you using now? Try to update node-gcm to |
Solved. Problem was in '\n' char in the key. Probably key should be validated? Thanks for help. |
I've got http error on sending gcm pushes:
The text was updated successfully, but these errors were encountered: