Skip to content

Commit e0541ec

Browse files
authored
feat: add support for APNS interruption-level and target-content-id (#197)
1 parent b6d1d4f commit e0541ec

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"nyc": "14.1.1"
3434
},
3535
"dependencies": {
36-
"@parse/node-apn": "5.0.0",
36+
"@parse/node-apn": "5.1.0",
3737
"@parse/node-gcm": "1.0.2",
3838
"npmlog": "4.1.2",
3939
"parse": "3.3.0"

spec/APNS.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ describe('APNS', () => {
183183
'sound': 'test',
184184
'content-available': 1,
185185
'mutable-content': 1,
186+
'targetContentIdentifier': 'window1',
187+
'interruptionLevel': 'passive',
186188
'category': 'INVITE_CATEGORY',
187189
'threadId': 'a-thread-id',
188190
'key': 'value',
@@ -200,6 +202,8 @@ describe('APNS', () => {
200202
expect(notification.aps.sound).toEqual(data.sound);
201203
expect(notification.aps['content-available']).toEqual(1);
202204
expect(notification.aps['mutable-content']).toEqual(1);
205+
expect(notification.aps['target-content-id']).toEqual('window1');
206+
expect(notification.aps['interruption-level']).toEqual('passive');
203207
expect(notification.aps.category).toEqual(data.category);
204208
expect(notification.aps['thread-id']).toEqual(data.threadId);
205209
expect(notification.payload).toEqual({

src/APNS.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ export class APNS {
199199
let isMutable = coreData['mutable-content'] === 1;
200200
notification.setMutableContent(isMutable);
201201
break;
202+
case 'targetContentIdentifier':
203+
notification.setTargetContentIdentifier(coreData.targetContentIdentifier);
204+
break;
205+
case 'interruptionLevel':
206+
notification.setInterruptionLevel(coreData.interruptionLevel);
207+
break;
202208
case 'category':
203209
notification.setCategory(coreData.category);
204210
break;

0 commit comments

Comments
 (0)