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

250 Коммитов

Автор SHA1 Сообщение Дата
Andrew Naylor 2a08286fe2 Merge branch 'refs/heads/issue101-hotfix' into develop 2013-05-25 13:01:23 +01:00
Andrew Naylor d878bf22e2 Don't blindly reject the deferredConnection when an error occurs
If a new connection is established before the error from the previous connection is thrown then a deferredConnection will exist and it will happily reject it, upsetting the new connection flow. In fact we should check that the error occurred on the in progress socket (`this.socket`) before we destroy that.

Otherwise just handle it as a regular socket error.
2013-05-25 12:58:40 +01:00
Andrew Naylor 0bc8130c11 Added better trace for sockets
Assign each socket an ID which can be used to track socket management problems.
2013-05-25 12:55:55 +01:00
Andrew Naylor 8deaae8c0e Added new error code, 10: apnsShutdown.
Table 5-1: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW4
2013-05-24 08:20:48 +01:00
Andrew Naylor 6c9bbf9bba Updated "Thanks to" with Craig Hockenberry. 2013-04-27 09:53:22 +01:00
Andrew Naylor 4ce08df129 1.3.3 2013-04-27 01:24:24 +01:00
Andrew Naylor 72df8050c8 Ensure `Notification#trim` cleanly trims Unicode characters
Also improve documentation around Unicode characters.

Closes #98
2013-04-27 01:22:38 +01:00
Andrew Naylor 21578b0674 Fixed pre-push notification length check. 2013-04-27 00:35:08 +01:00
Andrew Naylor 116218a356 1.3.2 2013-04-22 23:05:56 +01:00
Andrew Naylor 27ca322d81 Switch to EventEmitter#listeners().length for backward compatibility.
Fixes #97
2013-04-22 23:05:43 +01:00
Andrew Naylor c68c8bc673 v1.3.1 Release 2013-04-22 11:22:06 +02:00
Andrew Naylor c781053303 Updated for v1.3.1 2013-04-22 11:21:45 +02:00
Andrew Naylor 6c25c7e8e4 Warn about lack of `feedback` listener
If Feedback has been initialised but no listener has been added before nextTick then raise a debug warning as data may be lost.
2013-04-22 11:20:40 +02:00
Andrew Naylor bd5651d5ea Merge pull request #96 from futurice/master
`feedback` option in configuration is now optional in favor of an event listener on `'feedback'` however I did not remove a check that a `feedback` function has been specified.
2013-04-22 02:11:34 -07:00
Juho Vähä-Herttua 1d49d8b510 Feedback function is not necessary any more.
The v1.3.0 crashes if feedback function is not defiend, even though the comments
suggest it should not be used.
2013-04-22 11:40:08 +03:00
Andrew Naylor c64c936ee8 v1.3.0 Release. 2013-04-21 01:29:04 +01:00
Andrew Naylor f5f2c894e6 Added "resources" to Readme. 2013-04-21 01:28:48 +01:00
Andrew Naylor 037f641438 Added documentation 2013-04-21 01:28:34 +01:00
Andrew Naylor 4476bae2c8 Updated Readme to be shorter and more readable.
Moved documentation to separate files.
2013-04-20 00:32:12 +01:00
Andrew Naylor b42ce93193 Moved change log out of readme and added v1.3.0 2013-04-20 00:31:33 +01:00
Andrew Naylor d76046405b Fix a defect with cache auto adjustment. 2013-04-16 19:22:46 +01:00
Andrew Naylor c66b66fa30 Fixed a problem with promise being null 2013-04-15 22:54:25 +01:00
Andrew Naylor 2924f5dc86 Added a note to myself about a strange decision with the socket setup. 2013-04-13 22:01:26 +01:00
Andrew Naylor ae3642f84c Un-deprecated the Device object.
It turns out there are some uses for it after all, and there isn't a penalty to keeping it around.
2013-04-13 21:52:16 +01:00
Andrew Naylor ae80aab75d Removed some test log statements. 2013-04-11 22:55:50 +01:00
Andrew Naylor e11aa39738 Pass JSON directly into new Notification
Now possible to pass the JSON you wish to send to the device directly into new Notification instead of using the convenience methods.

Closes #94
2013-04-11 00:16:50 +01:00
Andrew Naylor 032cb7f47c Fixed multiple connections mode 2013-04-10 23:05:51 +01:00
Andrew Naylor 759dbbb1fe Updated emitted notification events to be backwards compatible.
Instead of returning the object which contains both the notification and the recipient, the notification and recipient are passed as separate arguments, this maintains backwards compatibility because code using the old API will be setting the device property on the notification anyway.
2013-04-10 22:56:54 +01:00
Andrew Naylor 32282dd802 Fix fastMode 2013-04-10 13:50:12 +02:00
Andrew Naylor 424d0f0ced Fixed token regular expression 2013-04-10 13:33:24 +02:00
Andrew Naylor 46f49e9b08 Updated JSDoc to reflect API change deprecating `Notification#clone()` 2013-04-09 23:09:12 +01:00
Andrew Naylor 1a0e439e50 Added some more debug information and updated the JSDoc for `connect` 2013-04-09 23:09:12 +01:00
Andrew Naylor d4cb53046c Do not remove listeners from socket to prevent uncaught errors and pre-emptively destroy to minimise EPIPE 2013-04-09 23:09:11 +01:00
Andrew Naylor 207d29380c Moved payload length checking to a more sensible place which solves a deadlock. 2013-04-09 23:09:09 +01:00
Andrew Naylor bd97a74ced Better device token sanitisation 2013-04-09 22:59:47 +01:00
Andrew Naylor d3cd4b65d1 Minor typo 2013-04-09 11:00:54 +02:00
Andrew Naylor a4559e0582 Tidied up `socketDrained` method to minimise redundant `serviceBuffer` calls on next event loop. 2013-04-08 23:59:37 +01:00
Andrew Naylor 60fb95faba Switched to setImmediate for node 0.10.x 2013-04-08 22:52:27 +01:00
Andrew Naylor 5eee99217c Another minor defect with the serviceBuffer code :( 2013-04-07 13:48:14 +01:00
Andrew Naylor c6b9960e85 Defect in serviceBuffer would prevent more than one notification sending. 2013-04-07 13:37:37 +01:00
Andrew Naylor 7843f14a80 Missed 2 checks when moving to q 0.9.x 2013-04-06 12:52:31 +01:00
Andrew Naylor cf1950a1e4 Updated feedback.js for q v0.9.x 2013-04-06 10:21:27 +01:00
Andrew Naylor 8b92581f39 Tidied up some dead code and renamed `dontServiceBuffer` to `delayServiceBuffer` 2013-04-06 10:21:27 +01:00
Andrew Naylor 372fa219e6 Attach socket event handlers in a more sensible way.
Using `#bind()` as it was intended
2013-04-06 10:21:19 +01:00
Andrew Naylor cce2fe8c60 Enabled the Nagle Algorithm. 2013-04-06 10:06:08 +01:00
Andrew Naylor e15ba67a72 Added 'fastMode' to aggressively empty the notification buffer
Enabling this option may not be advisable if node-apn runs within a larger application in-case it stalls while emptying a large buffer. In the case of high throughput it would be sensible to run node-apn within a separate worker process servicing a queue in which case the `fastMode` should be enabled.
2013-04-06 10:06:08 +01:00
Andrew Naylor a4e5580cf1 Incorrect transmission error event params
Formerly passing Error["none"] instead of the actual error code when notification wasn't found in the cache.
2013-04-05 17:42:12 +02:00
Mike Maelzer ad3135bb71 Fix Notification.trim() for alerts with multibyte chars. 2013-03-20 21:55:14 +00:00
Andrew Naylor 0ae733fc86 lint. 2013-03-20 21:55:14 +00:00
Josep f922bf2095 Added buffers notification option 2013-03-20 21:55:14 +00:00