Skip to content

Commit 76383d9

Browse files
alexanderedgeflovilmart
authored andcommitted
Support mutable-content (#27)
* Add mutable content expectation * Add mutable-content data field * Update package.json
1 parent a9089ec commit 76383d9

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"jasmine": "^2.4.1"
3333
},
3434
"dependencies": {
35-
"apn": "^1.7.5",
35+
"apn": "^1.7.8",
3636
"node-gcm": "^0.14.0",
3737
"npmlog": "^2.0.3",
3838
"parse": "^1.8.1"

spec/APNS.spec.js

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ describe('APNS', () => {
6767
'badge': 100,
6868
'sound': 'test',
6969
'content-available': 1,
70+
'mutable-content': 1,
7071
'category': 'INVITE_CATEGORY',
7172
'key': 'value',
7273
'keyAgain': 'valueAgain'
@@ -79,6 +80,7 @@ describe('APNS', () => {
7980
expect(notification.badge).toEqual(data.badge);
8081
expect(notification.sound).toEqual(data.sound);
8182
expect(notification.contentAvailable).toEqual(1);
83+
expect(notification.mutableContent).toEqual(1);
8284
expect(notification.category).toEqual(data.category);
8385
expect(notification.payload).toEqual({
8486
'key': 'value',

src/APNS.js

+4
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ function generateNotification(coreData, expirationTime) {
236236
let isAvailable = coreData['content-available'] === 1;
237237
notification.setContentAvailable(isAvailable);
238238
break;
239+
case 'mutable-content':
240+
let isMutable = coreData['mutable-content'] === 1;
241+
notification.setMutableContent(isMutable);
242+
break;
239243
case 'category':
240244
notification.category = coreData.category;
241245
break;

0 commit comments

Comments
 (0)