Skip to content

matiassingers/apn-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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