Comparing version 1.1.3 to 1.1.4
@@ -133,5 +133,9 @@ var tls = require('tls'); | ||
this.sendNotification = function (note) { | ||
var encoding = 'utf8'; | ||
if(note.encoding) { | ||
encoding = note.encoding; | ||
} | ||
var token = note.device.token; | ||
var message = JSON.stringify(note); | ||
var messageLength = Buffer.byteLength(message); | ||
var messageLength = Buffer.byteLength(message, encoding); | ||
var pos = 0; | ||
@@ -171,3 +175,3 @@ | ||
pos += int2buf(messageLength, data, pos, 2); | ||
pos += data.write(message, pos); | ||
pos += data.write(message, pos, encoding); | ||
@@ -174,0 +178,0 @@ writeNotificationToSocket(data); |
{ | ||
"name": "apn", | ||
"description": "An interface to the Apple Push Notification service for Node.js", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"author": "Andrew Naylor <argon@mkbot.net>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -63,2 +63,4 @@ #node-apn | ||
\* N.B.: If you wish to send notifications containing emoji or other multi-byte characters you will need to set `note.encoding = 'ucs2'`. This tells node to send the message with 16bit characters, however it also means your message payload will be limited to 127 characters. | ||
### Handling Errors | ||
@@ -134,2 +136,6 @@ | ||
1.1.4: | ||
* Fixes #15: Sending unified emoji via apn; Added encoding parameter when sending notification | ||
1.1.3: | ||
@@ -136,0 +142,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20525
386
178
1