easily send a test push notification
$ npm install --save apn-test
var apnTest = require('apn-test');
var message = 'Hello';
var options = {
cert: '/path/to/pushCert.pem',
key: '/path/to/pushKey.pem',
token: 'uney4jcnvvw5bc2vlvazog4au1xa0zbcbsjwlfgaj1pi9blcdltgktncfxfwhs5'
};
apnTest(message, options);
$ npm install --global apn-test
$ apn --help
quickly test push notifications
Usage
apn <message> --options
apn "Hello world" --token=uney4jcnvvw5bc2vlvazog4au1xa0zbcbsjwlfgaj1pi9blcdltgktncfxfwhs5
Options
--token
(required)
The device token you wish to send the notification to
Takes a single token or a comma-separated list of tokens
Enable debug messages by running the CLI with DEBUG=apn
, like so:
$ DEBUG=apn apn <message> --options
See the node-apn
documentation for more details.
Pass in args to the CLI with this syntax: apn --foo=bar
.
- cert (default
cert.pem
) - key (default
key.pem
) - token (required) accepts single token or a comma-separated list of tokens
- development
- badge - (default
0
) The value to specify forpayload.aps.badge
- sound - (default
ping.aiff
) The value to specify forpayload.aps.sound
- payload - (default
{}
) JSON encoded extra payload values - expiry - (default
1 hour
) The UNIX timestamp representing when the notification should expire. An expiry of 0 indicates that the notification expires immediately.
MIT © Matias Singers