Граф коммитов

250 Коммитов

Автор SHA1 Сообщение Дата
Andrew Naylor a34720f6bd Preparing for v1.3.0 with upgrade to q 0.9.0 with slightly different API. 2013-03-20 21:55:14 +00:00
Andrew Naylor a655741c56 Added deprecation notice to device.js 2013-03-20 21:54:24 +00:00
Andrew Naylor 72934fdea5 lint. 2013-03-20 21:54:24 +00:00
Andrew Naylor 5b34c4ea8c New API to support sending one notification to multiple devices.
One notification object can be sent to multiple devices while only one copy of the notification is kept in memory.
* You should use the new `pushNotification` method to benefit from this. Instead of setting `Notification#device` you instead need to pass an array of device tokens to `pushNotification` as the second parameter.
* The notification object returned by errors has changed structure.
* There is now code to support multiple connections sending notifications but this isn't fully enabled yet, it may work in your environment but hasn't been tested.
2013-03-20 21:54:24 +00:00
Andrew Naylor cd79d53450 Fixed event emitting in feedback.js 2013-03-20 21:52:54 +00:00
Andrew Naylor 041215690d lint. 2013-03-20 21:52:54 +00:00
Andrew Naylor 0743bb68d6 Fixed typo in documentation 2013-03-20 21:50:10 +00:00
Andrew Naylor f2488b6dc1 Updated feedback service to emit events.
Backwards compatibility is maintained with the previous callback system by attaching them to events. Passing callback functions is deprecated and this will eventually be removed.
2013-03-20 21:48:46 +00:00
Andrew Naylor cb4cb829ee v1.2.6 2013-02-28 20:04:21 +00:00
Andrew Naylor a1a5a656f1 Fixed mdm support. 2013-02-28 19:57:02 +00:00
Olivier Louvignes b3dad81c7a add support for mdm push notifications 2013-02-28 19:57:02 +00:00
Andrew Naylor 673c67b358 Merge pull request #82 from porsager/master
Q 0.9 has removed isResolved which breaks node-apn. Updated package json depenency to 0.8.x which solves it for now.
2013-02-28 03:05:35 -08:00
porsager e4a3550b9b Update package.json
q was updated and has removed features. Dependency should not be as loose as higher than X version
2013-02-28 11:11:31 +01:00
Andrew Naylor 838a9e4a3a Merge pull request #79 from thegreatmichael/master
added the missing comma for #78
2013-01-27 03:22:27 -08:00
Michael Stewart f2c831a64e added missing comma in example code, fixes #78 2013-01-24 11:08:45 -05:00
Andrew Naylor c0d6718932 Merge pull request #75 from michaelvillar/master
Fixed error in trim() of notification
2013-01-11 03:24:41 -08:00
Michael Villar 1ea3db18a7 Fixed error in trim() of notification 2013-01-10 16:54:50 -08:00
Andrew Naylor ff57e7bf22 Added some missing detail to the readme for PFX packages. 2012-12-22 00:19:53 +00:00
Andrew Naylor 25038d502e v1.2.5 2012-12-22 00:12:40 +00:00
Andrew Naylor 70f807765c Merge branch 'develop' of git://github.com/rwtombaugh/node-apn into master 2012-12-21 23:52:31 +00:00
Randall Tombaugh e2438ed798 Updating readme. 2012-12-19 11:04:30 -08:00
Andrew Naylor 316522c95f This 'end' listener should have been removed with the previous commit. 2012-11-30 15:39:10 +00:00
Andrew Naylor b1e3d6a84e Removed erroneous #destroyConnection call
This is hopefully the cause of all the pain in #65
2012-11-30 14:23:25 +00:00
Andrew Naylor eb3463d65b Reorganised socket connect code to allow event handlers to attach before connection 2012-11-30 01:54:28 +00:00
Andrew Naylor a138edcfba Fixed typo. 2012-11-29 16:35:30 +00:00
Andrew Naylor cee13fd55a Added a check to ensure the error handling doesn't fail when there are no cached notifications. 2012-11-29 12:56:11 +00:00
Andrew Naylor 598fadba35 Destroy connection when 'end' event occurs to prevent EPIPE errors. 2012-11-29 12:41:50 +00:00
Andrew Naylor 77ade69025 Tidied up code to use double-quotes 2012-11-29 12:39:48 +00:00
Andrew Naylor 7f24407535 Updated the timeout handling code because strange behaviour was observed. 2012-11-26 15:56:28 +00:00
Andrew Naylor acdbd2104c Changed "Contributors" to "Thanks to".
I am extremely grateful for the work performed by the people listed and I wish to extend my thanks to them. However, as they have not directly contributed large quantities of code I am apprehensive to use the term Contributors. I hope this decision does not upset anyone.
2012-11-22 14:48:28 +00:00
Andrew Naylor 421c7fd5a0 Introduced a new event model, connection timeouts and auto cache adjustment.
Two new options:
autoAdjustCache. If Apple returns an error for a notification which has been lost due to the cache being too small, when this is set to true the module will make a simple estimate of how many notifications have been lost and increase the cacheLength by twice that amount.

connectionTimeout. Set the socket connection timeout value, if set (value >0 in milliseconds) then after a period of inactivity the socket will automatically disconnect. Note: if further notifications are sent the socket will be re-established automatically.

*********

When a connection is created it is now possible to add eventListeners to monitor the modules progress.

Events (arguments):

- error (error): emitted when an error occurs during initialisation of the module, usually due to a problem with the keys and certificates.

- transmitted (notification): emitted when a notification has been sent to Apple - not a guarantee that it has been accepted by Apple, an error relating to it make occur later on. A notification may also be sent several times if an earlier notification caused an error requiring retransmission.

- timeout: emitted when the connectionTimeout option has been specified and no activity has occurred on a socket for a specified duration. The socket will be closed immediately after this event.

- connected: emitted when the connection to Apple is successfully established. No action is required as the connection is managed internally.

- disconnected: emitted when the connection to Apple has been closed, this could be for numerous reasons, for example an error has occurred or the connection has timed out. No action is required.

- socketError (error): emitted when the connection socket experiences an error. This is useful for debugging but no action should be necessary.

- transmissionError (error code, notification): emitted when a message has been received from Apple stating that a notification was invalid. If we still have the notification in cache it will be passed as the second argument, otherwise null.

- cacheTooSmall (difference): emitted when Apple returns a notification as invalid but the notification has been expunged from the cache - usually due to high throughput. The parameter estimates how many notifications have been lost.
2012-11-22 14:42:58 +00:00
Andrew Naylor b793608c19 Some corrections to the PFX loading code. 2012-11-19 16:44:29 +00:00
Andrew Naylor d4395a9485 Fixed a leak found by Alberto Gimeno (@gimenete) 2012-11-19 16:33:27 +00:00
Andrew Naylor 4941c807c8 Improved some error handling.
Trying to attach error handler as soon as possible as it seems to be getting delayed.
Added a stack trace in raiseError though I'm not sure it'll do much
Improved a check when sending notifications if the socket is not available.
2012-11-19 16:29:35 +00:00
Andrew Naylor 5e21b868e4 Enable the TCP Nagle Algorithm as recommended by Apple 2012-11-19 16:27:46 +00:00
Randall Tombaugh 2ad7e60a50 Added support for per notification error callbacks. 2012-10-16 15:54:36 -07:00
Randall Tombaugh 3f87814e5f Added batched feedback feature. 2012-10-16 15:46:47 -07:00
Randall Tombaugh 7b02d30f7a fix for pfx file support 2012-10-10 13:08:02 -07:00
Andrew Naylor 97a9aebcfa Initial support for PFX (PKCS12) files. 2012-10-04 22:29:16 +01:00
Andrew Naylor 1ec14c8fe3 Merge pull request #66 from 4mo1/master
feedback service via proxy also requires rejectUnauthorized flag
2012-10-04 13:42:46 -07:00
Amol Neurgaonkar 6b3daa143d Add support for rejectUnauthorized in socket options when using a local proxy 2012-10-04 10:13:33 -07:00
Andrew Naylor 1fc5255c7a Added nsabovic to readme. 2012-09-24 16:00:15 +02:00
Andrew Naylor 1db7057068 Added a documentation note for rejectUnathorized 2012-09-24 15:58:21 +02:00
Andrew Naylor faebb57cf2 Merge pull request #64 from nsabovic/master
Add rejectUnauthorized as an option.
2012-09-24 06:56:01 -07:00
Nebojsa Sabovic 2dd8215b79 Add support for rejectUnauthorized in socket options. 2012-09-18 15:34:38 -07:00
Nebojsa Sabovic 2274061694 Don't explicitly reject unauthorized connections.
The same behavior can be accomplished with rejectUnauthorized in socketOptions.
2012-09-18 15:28:42 -07:00
Andrew Naylor 613fbda1ce Clarified the README further. 2012-08-02 18:25:09 +01:00
Andrew Naylor 9e922e4ce8 v1.2.4 2012-08-02 18:21:09 +01:00
Andrew Naylor 46b324759e Tidied up debug module loading. Fixed some typos in feedback.js, thanks to AsadR 2012-08-02 18:20:01 +01:00
Andrew Naylor 47aa23858e Version 1.2.3 2012-07-07 10:45:23 +01:00