quickly test push notifications
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig Initial commit Nov 25, 2014
.gitignore
.jshintrc Initial commit Nov 25, 2014
.travis.yml Update .travis.yml + create coverage npm script Jun 2, 2015
cli.js
index.js
license Initial commit Nov 25, 2014
package.json 1.3.1 Jun 8, 2015
readme.md Add related section to readme Jan 27, 2015
test.js Fix broken test because of lodash.noop module missing Apr 9, 2015

readme.md

apn-test Build Status Dependency Status Coverage Status

easily send a test push notification

Install

$ npm install --save apn-test

Usage

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);

CLI

$ 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

Debug

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.

Options

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 for payload.aps.badge
  • sound - (default ping.aiff) The value to specify for payload.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.

Related

License

MIT © Matias Singers