Keep Provider alive or shutdown() every time?

75 views
Skip to first unread message

ma...@neoos.ch

unread,
Jun 20, 2017, 1:36:19 PM6/20/17
to node-apn
We've been using this library for quite some time now, very successfully.
Yet, one thing has never really been 100% clear to us: How is this library intended to be used in terms of handling the connection to the APNS service?
It has never reliably worked for us to keep the connection open all the time (or keep the Provider alive, for that matter). Instead we create a new Provider every time we need to send a notification and then shutdown() the Provider afterwards.

So, what's the intented/recommended way to use this library? Is it really to shutdown() the Provider or is it to keep Providers alive for a long time? If so, in the docs it's mentioned that it will retry if there are errors. What happens if the socket connection of the provider is closed after e.g. some days/weeks of use? Will it reconnect "automatically" or do we need to initiate a reconnect in the appropriate callback?

Any hints welcome, thanks so much.
Reply all
Reply to author
Forward
0 new messages