From e2c63dbbc7cc0b59172126218784d434dac08d41 Mon Sep 17 00:00:00 2001 From: MANISH PRAJAPATI Date: Wed, 1 Jul 2020 10:46:16 +0530 Subject: [PATCH] Update index.js Fixing the issue for apn error "missingtopics" --- lib/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 59eca58..302d496 100644 --- a/lib/index.js +++ b/lib/index.js @@ -23,7 +23,7 @@ const PushNotification = options => { return Promise.reject(new Error('unknow device type')); }, - pushToAPN(tokens, {title, message, badge, sound = 'default', payload}) { + pushToAPN(tokens, {title, message, badge, sound = 'default', payload, topic=''}) { if (!apnSender) { return Promise.reject(new Error('options.apn is required...')); } @@ -35,7 +35,8 @@ const PushNotification = options => { alert: {title, body: message}, sound, badge, - payload + payload, + topic }); return apnSender.send(notification, devices); },