appfeel / node-pushnotifications

Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
MIT License
534 stars 126 forks source link

ADM should be ignored but returns Invalid Client ID #85

Closed amangeot closed 6 years ago

amangeot commented 6 years ago

Hello, I'm using this package for sending notifications to android and ios devices, it works very well so far.

I recently started logging all result messages and realized I had some errors coming from ADM which is not set on my configuration:

Error: Invalid client ID.
       at Sender.authenticate (/var/www/backend/node_modules/node-adm/lib/sender.js:20:21)

Here are my settings:

export const settings = {
  apn: ...,
  gcm: ...,
}

Am I misusing the API?

alex-friedl commented 6 years ago

Hello @amangeot, it looks like a token is incorrectly detected as ADM. I assume you are using the latest version of the library? Could you provide me with the token, which is being passed to the sendADM function?

Thank you!

alex-friedl commented 6 years ago

Hello @amangeot , do you still have this issue? There were similar old bugs, like https://github.com/appfeel/node-pushnotifications/issues/53 that were fixed in a recent release. Please check if you have the latest release in use.

amangeot commented 6 years ago

Sorry I missed your first message, I will have to check but It was with the version .0.18.

I upgraded the latest version using APN token authentication, though I encounter memory leaks.

alex-friedl commented 6 years ago

Hello, 1.0.19 should fix the incorrect ADM token match as well as include a fix for the memory leak. Let me know if everything works fine after updating :)

amangeot commented 6 years ago

Thank you for the quick replies, I confirm it was with 1.0.18.

I'm trying to upgrade to 1.0.21 though I get an very unusual error running sudo npm install.

npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b httpsPort git://github.com/alex-friedl/wns.git /root/.npm/_cacache/tmp/git-clone-d37e41b3
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-d37e41b3': Permission denied

It has something to do with my setup though I really struggle to get passed it

alex-friedl commented 6 years ago

You shouldn't have to use sudo for npm install I assume you have a working git installation? Could you delete your working directory/repository, check it out freshly and run npm install without sudo ?

amangeot commented 6 years ago

Yes you're right, I created a new non-root working directory, it installed without a problem. I'm testing with 1.0.21, I'll let you know asap

amangeot commented 6 years ago

I'll close this issue as the error for ADM doesn't show up any longer with 1.0.21 👍