Skip to content

Commit 4695e4a

Browse files
committed
fix: Allow sending the priority of 10 for notifications
1 parent 34b756b commit 4695e4a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/notification/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Notification.prototype = require('./apsProperties');
6868
Notification.prototype.headers = function headers() {
6969
const headers = {};
7070

71-
if (this.priority !== 10) {
71+
if (Number.isInteger(this.priority)) {
7272
headers['apns-priority'] = this.priority;
7373
}
7474

test/notification/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,15 @@ describe('Notification', function () {
154154
expect(note.headers()).to.deep.equal({
155155
'apns-channel-id': 'io.apn.channel',
156156
'apns-expiration': 1000,
157+
"apns-priority": 10,
157158
'apns-request-id': 'io.apn.request',
158159
});
159160
});
160161
});
161162

162163
describe('headers', function () {
163-
it('contains no properties by default', function () {
164-
expect(note.headers()).to.deep.equal({});
164+
it('contains only thr priority property by default', function () {
165+
expect(note.headers()).to.deep.equal({ "apns-priority": 10 });
165166
});
166167

167168
context('priority is non-default', function () {

0 commit comments

Comments
 (0)