appfeel / node-pushnotifications

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

TypeError: apn.Connection is not a function #18

Closed JohanWillfred closed 7 years ago

JohanWillfred commented 7 years ago

Hi! Error after modules update. The problem can be reproduced on attempt to send APNS push. Looks like problem in updated APN library

ser-j commented 7 years ago

I have the same issue here.

Looks like the problem in node-apn module, in updated version (2.1.1) it hasn't connection.js at all.

Seems we have to change package.json:

"dependencies": { "apn": "*",

to

"dependencies": { "apn": "^1.7.8",

JohanWillfred commented 7 years ago

@ser-j Yes, it will fix the problem, but in my case (node-lambda) it is better to use APN directly. And as I saw there are all dependencies with "*", so I think that it will be better to change lib, coz same situation can happen again with any of depended modules.

Thank you for your response)

ryanthegiantlion commented 7 years ago

This is a duplicate of #17 and should probably be closed.

appfeel commented 7 years ago

Yes, thanks solved in https://github.com/appfeel/node-pushnotifications/pull/11