Skip to content

Commit 1f1f9ab

Browse files
authored
Update APNS.js (#89)
* Update APNS.js * Update APNS.spec.js * Update APNS.spec.js
1 parent af48cbc commit 1f1f9ab

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

spec/APNS.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ describe('APNS', () => {
160160
//Mock request data
161161
let data = {
162162
'alert': 'alert',
163+
'title': 'title',
163164
'badge': 100,
164165
'sound': 'test',
165166
'content-available': 1,
@@ -173,7 +174,7 @@ describe('APNS', () => {
173174

174175
let notification = APNS._generateNotification(data, { expirationTime: expirationTime, collapseId: collapseId });
175176

176-
expect(notification.aps.alert).toEqual(data.alert);
177+
expect(notification.aps.alert).toEqual({ body: 'alert', title: 'title' });
177178
expect(notification.aps.badge).toEqual(data.badge);
178179
expect(notification.aps.sound).toEqual(data.sound);
179180
expect(notification.aps['content-available']).toEqual(1);

src/APNS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class APNS {
178178
notification.setAlert(coreData.alert);
179179
break;
180180
case 'title':
181-
notification.setAlertTitle(coreData.title);
181+
notification.setTitle(coreData.title);
182182
break;
183183
case 'badge':
184184
notification.setBadge(coreData.badge);

0 commit comments

Comments
 (0)