hand-over-apns
v1.0.0-0
Published
Apple Push Notification Service plugin for Handover
Downloads
3
Maintainers
Readme
Apple Push Notification Service plugin for Handover.
Usage
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, // 1 hour
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!')
}
Note: Options are passed to the apn package's Connection
constructor.
Installation
With npm:
npm install hand-over-apns