Closed elmigranto closed 9 years ago
Okay, @j3k0, try to send notifcation now, if it doesn't work, can you please show what it looks like and what redis contents are?
Also, bunyan's log.debug
doesn't show up in the output for me, any specific level I must set?
@elmigranto DEBUG is level 20. (https://github.com/trentm/node-bunyan#levels)
I will try and let you know!
Works!
I also made sure notification.push
is removed from APN's payload (it would be redondant). Actually, I think a safer way would be to select which fields to copy from notification
to payload
1 by 1 (in case we later add other sensitive informations in notification
, we may forgot to hide it from the push notification, with security implications)
Fields to copy: data
, to
, timestamp
, from
, type
, id
, push
While writing the client-side push handling code, I realized having the notification.push
object available is actually useful, because it is "provider-independant".
This allows to write more generic handling code.
I added some more logging in this PR for failed sends. It is delayed sometime and might not show up before process exits due to how
apn
works. (There seems to be no way to know whether notification was sent successfully and accepted.)When specifying
options.maxConnections
fornew apn.Connection
, I thought it would open multiple connections to Apple server, but it fires upconnected
event with only one. Should not be a problem, though, possibly it manages it internally and only adds more when 1 isn't enough.Seems like this was the case, should be fixed now.