Skip to content

Commit 005fa2a

Browse files
committed
add support for "interruption-level" and "target-content-id"
1 parent 8870248 commit 005fa2a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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)