I've some question about node-apn. I have three iOS apps which want to send push notifications.
I created 3 connections using apn.Connection, is this connection persistent? Should I create a connection to APNs and send one push notification every time? Can I create a connection, then send many push notification later? What if I send first push notification one day later after I create connection?
What does connectionTimeout exactly do?
The connection will maintain an underlying persistent connection, yes. You can use one apn.Connection per app and send all notifications through that object. If an internal connection doesn't exist it will create one and maintain it while it is necessary, if the connection fails and no notifications are pending it will not establish a new connection until more notifications need to be sent.
connectionTimeout will tell apn.Connection to close the underlying connection after a defined number of seconds if there has been no traffic. It does not mean that the apn.Connection object can no longer be used, simply push another notification and it will reopen a connection automatically.