diff --git a/spec/APNS.spec.js b/spec/APNS.spec.js index b75eb493..aec489f3 100644 --- a/spec/APNS.spec.js +++ b/spec/APNS.spec.js @@ -160,6 +160,7 @@ describe('APNS', () => { //Mock request data let data = { 'alert': 'alert', + 'title': 'title', 'badge': 100, 'sound': 'test', 'content-available': 1, @@ -173,7 +174,7 @@ describe('APNS', () => { let notification = APNS._generateNotification(data, { expirationTime: expirationTime, collapseId: collapseId }); - expect(notification.aps.alert).toEqual(data.alert); + expect(notification.aps.alert).toEqual({ body: 'alert', title: 'title' }); expect(notification.aps.badge).toEqual(data.badge); expect(notification.aps.sound).toEqual(data.sound); expect(notification.aps['content-available']).toEqual(1); diff --git a/src/APNS.js b/src/APNS.js index 794a12e4..5fa40bea 100644 --- a/src/APNS.js +++ b/src/APNS.js @@ -178,7 +178,7 @@ export class APNS { notification.setAlert(coreData.alert); break; case 'title': - notification.setAlertTitle(coreData.title); + notification.setTitle(coreData.title); break; case 'badge': notification.setBadge(coreData.badge);