Comparing version 1.2.5 to 1.2.6
@@ -28,3 +28,3 @@ /** | ||
var notification = new Notification(); | ||
notification.encoding = this.encoding; | ||
@@ -40,3 +40,4 @@ notification.payload = this.payload; | ||
notification.newsstandAvailable = this.newsstandAvailable; | ||
notification.mdm = this.mdm; | ||
return notification | ||
@@ -153,3 +154,3 @@ } | ||
if(typeof this.alert == "string") { | ||
var length = Buffer.byteLength(this.alert.length, this.encoding || 'utf8'); | ||
var length = Buffer.byteLength(this.alert, this.encoding || 'utf8'); | ||
if (length < tooLong) { | ||
@@ -162,3 +163,3 @@ return length - tooLong; | ||
else if(typeof this.alert == "object" && typeof this.alert.body == "string") { | ||
var length = Buffer.byteLength(this.alert.body.length, this.encoding || 'utf8'); | ||
var length = Buffer.byteLength(this.alert.body, this.encoding || 'utf8'); | ||
if (length < tooLong) { | ||
@@ -180,2 +181,6 @@ return length - tooLong; | ||
} | ||
if (typeof this.mdm == 'string') { | ||
this.payload.mdm = this.mdm; | ||
return this.payload; | ||
} | ||
if (this.payload.aps === undefined) { | ||
@@ -199,2 +204,2 @@ this.payload.aps = {}; | ||
module.exports = Notification; | ||
module.exports = Notification; |
{ | ||
"name": "apn", | ||
"description": "An interface to the Apple Push Notification service for Node.js", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"author": "Andrew Naylor <argon@mkbot.net>", | ||
@@ -20,6 +20,6 @@ "contributors": [ | ||
"dependencies": { | ||
"q": ">=0.8.5" | ||
"q": "0.8.x" | ||
}, | ||
"engines": { "node": ">= 0.6.6" }, | ||
"license": "MIT" | ||
} | ||
} |
@@ -52,3 +52,3 @@ #node-apn | ||
errorCallback: undefined, /* Callback when error occurs function(err,notification) */ | ||
cacheLength: 100 /* Number of notifications to cache for error purposes */ | ||
cacheLength: 100, /* Number of notifications to cache for error purposes */ | ||
autoAdjustCache: true, /* Whether the cache should grow in response to messages being lost after errors. */ | ||
@@ -179,3 +179,3 @@ connectionTimeout: 0 /* The duration the socket should stay alive with no activity in milliseconds. 0 = Disabled. */ | ||
Thanks to: [Ian Babrou][bobrik], [dgthistle][dgthistle], [Keith Larsen][keithnlarsen], [Mike P][mypark], [Greg Bergé][neoziro], [Asad ur Rehman][AsadR], [Nebojsa Sabovic][nsabovic], [Alberto Gimeno][gimenete], [Randall Tombaugh][rwtombaugh] | ||
Thanks to: [Ian Babrou][bobrik], [dgthistle][dgthistle], [Keith Larsen][keithnlarsen], [Mike P][mypark], [Greg Bergé][neoziro], [Asad ur Rehman][AsadR], [Nebojsa Sabovic][nsabovic], [Alberto Gimeno][gimenete], [Randall Tombaugh][rwtombaugh], [Michael Stewart][thegreatmichael], [Olivier Louvignes][mgcrea], [porsager][porsager] | ||
@@ -215,2 +215,5 @@ ## License | ||
[rwtombaugh]: https://github.com/rwtombaugh | ||
[thegreatmichael]: https://github.com/thegreatmichael | ||
[mgcrea]: https://github.com/mgcrea | ||
[porsager]: https://porsager | ||
[q]: https://github.com/kriskowal/q | ||
@@ -220,2 +223,9 @@ | ||
1.2.6: | ||
* Added mdm support. | ||
* Constrained 'q' module to 0.8.x because 0.9.0 is API incompatible. | ||
* Fixed a `trim()` bug when compiling notification. | ||
* ***NOTICE:*** v1.3.0 which will be released soon will break some API compatibility with error handling and there will be a new sending API (the legacy sending API will remain) | ||
1.2.5: | ||
@@ -222,0 +232,0 @@ |
83011
332
909
+ Addedq@0.8.12(transitive)
- Removedasap@2.0.6(transitive)
- Removedpop-iterate@1.0.1(transitive)
- Removedq@2.0.3(transitive)
- Removedweak-map@1.0.8(transitive)
Updatedq@0.8.x