const Handover = require('hand-over'),
notifier = new Handover
notifier.use('apns', {
cert: 'path/to/certificate.pem',
key: 'path/to/key.pem',
passphrase: 'your passphrase',
})
notifier.send('userId', {
expiry: Math.floor(Date.now() / 1000) + 3600,
count: 42,
sound: 'ping.aiff',
alert: 'Notification title',
payload: { test: 'test' }
}, callback)
function callback(err) {
if (err)
console.error(err.stack)
else
console.log('yay!')
}