diff --git a/lib/notification/index.js b/lib/notification/index.js index d4e60432..bccff3b7 100644 --- a/lib/notification/index.js +++ b/lib/notification/index.js @@ -68,7 +68,7 @@ Notification.prototype = require('./apsProperties'); Notification.prototype.headers = function headers() { const headers = {}; - if (this.priority !== 10) { + if (Number.isInteger(this.priority)) { headers['apns-priority'] = this.priority; } diff --git a/test/notification/index.js b/test/notification/index.js index a74bd1de..832ed17f 100644 --- a/test/notification/index.js +++ b/test/notification/index.js @@ -154,14 +154,15 @@ describe('Notification', function () { expect(note.headers()).to.deep.equal({ 'apns-channel-id': 'io.apn.channel', 'apns-expiration': 1000, + "apns-priority": 10, 'apns-request-id': 'io.apn.request', }); }); }); describe('headers', function () { - it('contains no properties by default', function () { - expect(note.headers()).to.deep.equal({}); + it('contains only the priority property by default', function () { + expect(note.headers()).to.deep.equal({ "apns-priority": 10 }); }); context('priority is non-default', function () {