googlearchive / web-push-encryption

[Deprecated] Encryption Utilities for Web Push protocol
Apache License 2.0
84 stars 23 forks source link

When do I get 'UnauthorizedRegistration' 400 error? #29

Closed timeseer closed 8 years ago

timeseer commented 8 years ago

When I sent without payload and encryption, it worked.

{"multicast_id":734392...,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:14609..."}]}

But when I sent via sendWebPush with same authToken, it returned 400 error like below.

{ statusCode: 400,
  statusMessage: 'UnauthorizedRegistration',
  body: '<HTML>\n<HEAD>\n<TITLE>UnauthorizedRegistration</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>UnauthorizedRegistration</H1>\n<H2>Error 400</H2>\n</BODY>\n</HTML>\n' }

When do I get 'UnauthorizedRegistration' 400 error? ;-(

timeseer commented 8 years ago

It worked after when I activate free evalution account of Google Cloud Platform. Sorry for my mistake!

hraban commented 8 years ago

For people reaching this through Google: what did it for me was setting the correct gcm_sender_id in the manifest.json. I had copied a sample codebase and had forgotten to update that part.