1.0.0-0 • Published 10 years ago

hand-over-apns v1.0.0-0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

view on npm downloads per month node version build status test coverage license

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

License

MIT