Comparing version 1.7.5 to 1.7.6
## Changelog | ||
1.7.6: | ||
* Emit an error when retry limit is exceeded (#333) | ||
* Documentation fixes (#229, #343, #379) | ||
* Reinstate broken aps behaviour (#377) | ||
1.7.5: | ||
@@ -4,0 +10,0 @@ |
@@ -276,2 +276,3 @@ "use strict"; | ||
this.rejectBuffer(Errors.connectionRetryLimitExceeded); | ||
this.emit("error", error); | ||
this.shutdown(); | ||
@@ -278,0 +279,0 @@ this.terminated = true; |
@@ -483,5 +483,5 @@ "use strict"; | ||
aps.badge = this.badge; | ||
aps.sound = this.sound; | ||
aps.alert = this.alert; | ||
aps.badge = this.badge || aps.badge; | ||
aps.sound = this.sound || aps.sound; | ||
aps.alert = this.alert || aps.alert; | ||
if (this.contentAvailable) { | ||
@@ -491,4 +491,4 @@ aps["content-available"] = 1; | ||
aps["url-args"] = this.urlArgs; | ||
aps.category = this.category; | ||
aps["url-args"] = this.urlArgs || aps["url-args"]; | ||
aps.category = this.category || aps.category; | ||
@@ -495,0 +495,0 @@ return Object.keys(aps).reduce(function(populated, key) { |
{ | ||
"name": "apn", | ||
"description": "An interface to the Apple Push Notification service for Node.js", | ||
"version": "1.7.5", | ||
"version": "1.7.6", | ||
"author": "Andrew Naylor <argon@mkbot.net>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -99,3 +99,3 @@ #node-apn | ||
You should only create one `Connection` for each certificate/key pair you have, you do not need to create a new one for each notification. If you are only sending notifications to one app then there is no need for more than one `Connection`, if throughput is a problem then look at the `maxConnections` property. | ||
You should only create one `Connection` per-process for each certificate/key pair you have. You do not need to create a new `Connection` for each notification. If you are only sending notifications to one app then there is no need for more than one `Connection`, if throughput is a problem then look at the `maxConnections` property. | ||
@@ -171,3 +171,3 @@ ### Setting up the feedback service | ||
[pl]: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW1 "Local and Push Notification Programming Guide: Apple Push Notification Service" | ||
[fs]: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW3 "The Feedback Service" | ||
[fs]: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Appendixes/BinaryProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH106-SW4 "The Feedback Service" | ||
[tn2265]: http://developer.apple.com/library/ios/#technotes/tn2265/_index.html "Troubleshooting Push Notifications" | ||
@@ -174,0 +174,0 @@ [googlegroup]:https://groups.google.com/group/node-apn "node-apn Google Group" |
@@ -531,7 +531,32 @@ var apn = require("../"); | ||
describe("when aps payload is present", function() { | ||
beforeEach(function() { | ||
note.payload = {"foo": "bar", "baz": 1, "aps": { "badge": 1, "alert": "Hi there!" }}; | ||
}); | ||
it("contains all original payload properties", function() { | ||
note.payload = {"foo": "bar", "baz": 1}; | ||
expect(note.toJSON()).to.contain.all.keys(["foo", "baz"]); | ||
expect(note.toJSON()).to.have.property("foo", "bar"); | ||
expect(note.toJSON()).to.have.property("baz", 1); | ||
}); | ||
it("contains the correct aps properties", function() { | ||
expect(note.toJSON()).to.have.deep.property("aps.badge", 1); | ||
expect(note.toJSON()).to.have.deep.property("aps.alert", "Hi there!"); | ||
}); | ||
}); | ||
context("when passed in the notification constructor", function() { | ||
beforeEach(function() { | ||
note = new apn.Notification({"foo": "bar", "baz": 1, "aps": { "badge": 1, "alert": "Hi there!" }}); | ||
}); | ||
it("contains all original payload properties", function() { | ||
expect(note.toJSON()).to.have.property("foo", "bar"); | ||
expect(note.toJSON()).to.have.property("baz", 1); | ||
}); | ||
it("contains the correct aps properties", function() { | ||
expect(note.toJSON()).to.have.deep.property("aps.badge", 1); | ||
expect(note.toJSON()).to.have.deep.property("aps.alert", "Hi there!"); | ||
}); | ||
}); | ||
}); | ||
@@ -538,0 +563,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
245309
3829