Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yujinlim/node-gcm-cli
NodeJS GCM test command line interface to test gcm on your android application
https://github.com/yujinlim/node-gcm-cli
Last synced: 2 months ago
JSON representation
NodeJS GCM test command line interface to test gcm on your android application
- Host: GitHub
- URL: https://github.com/yujinlim/node-gcm-cli
- Owner: yujinlim
- License: mit
- Created: 2014-12-11T07:53:22.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-18T16:58:29.000Z (over 8 years ago)
- Last Synced: 2024-03-24T20:44:14.396Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Node GCM CLI [![Build Status](http://img.shields.io/travis/yujinlim/node-gcm-cli.svg?style=flat-square)](https://travis-ci.org/yujinlim/node-gcm-cli) [![Dependency Status](http://img.shields.io/gemnasium/yujinlim/node-gcm-cli.svg?style=flat-square)](https://gemnasium.com/yujinlim/node-gcm-cli) [![Coverage Status](https://coveralls.io/repos/yujinlim/node-gcm-cli/badge.png)](https://coveralls.io/r/yujinlim/node-gcm-cli)
============NodeJs CLI to test gcm on your android application
## Installation
```
$ npm install gcm-test
```
## Usage
```Javascriptvar gcmTest = require('gcm-test');
gcmTest('hello world', ['123'], {
apiKey: '123'
}, function(err, response){
console.log(err, response);
});// send data as an object
gcmTest({
message: 'hello world',
path: 'landing'
}, ['123'], {
apiKey: '123'
}, function(err, response){
console.log(err, response);
});
```
## CLI
```
$ npm install -g gcm-test$ gcm --help
Usage: cli [options]
Options:
-h, --help output usage information
-V, --version output the version number
-m, --message message that you wish to send (string or key-value), eg: --message="message:this is test,path:landing"
-k, --apiKey google api key
-r, --registrationids comma separated ids, if more than one
-c, --collapseKey collapse key for android
-d, --delayWhileIdle `If the device is connected but idle, the message will still be delivered right away unless the delayWhileIdle flag is set to true`, (default to false)
-t, --timeToLive## Examples
```
$ gcm -m "message:testing,path:landing" -j -k -r
```## Options
- **apiKey** : google api key
- **collapseKey** : collapse key for message to send to the same registration id
- **delayWhileIdle** : if true, message will be send to user when device is active
- **timeToLive** : maximum period of time for which GCM will store and try to deliver the message (from 0 to 2,419,200 seconds)
- **dryRun** : for debug/ test purpose, it allows for sending a message without really sending it## License
The MIT License (MIT)Copyright (c) 2014 yujinlim
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.