Cordova Push Server is a cross-plateform push server based on node-apn and node-gcm. Cordova Push Server currently supports iOS (APN) and android (GCM) platforms.
Cordova Push Server can be called in shell:
$ cordovapush
Or in a JavaScript application:
var cordovapush = require('cordovapush');
The documentation is here.
- MongoDB (MongoDB Download page).
Start MongoDB:
$ sudo mongod
$ npm install -g cordovapush
$ cordovapush new [server_name]
$ cd [server_name]
$ cordovapush start
GCM service configuration:
{
sender : 'api_key' /* Your API Key */
}
See GCM documentation.
APN service configuration:
{
cert: 'absolute/path/to/the/cordovapush.pem', /* Certificate file path */
key: 'absolute/path/to/the/cordovapushkey.pem', /* Key file path */
passphrase: '****', /* Passphrase for the Key file */
gateway: 'gateway.sandbox.push.apple.com', /* Gateway address */
port: 2195, /* Gateway port */
enhanced: true, /* Enable enhanced format */
cacheLength: 100 /* Number of notifications to cache */
}
Web server configuration:
{
port : 8080, /* Listening port */
debug : true /* Active logging request mode */
}
MongoDB configuration:
{
url : 'mongodb://localhost/cordova' /* MongoDB URL */
}
http://domain:port/send (GET & POST)
http://domain:port/subscribe (POST)
or
http://domain:port/save (POST)
data:
{
type : device_type (android || ios),
token : device_token
}
http://domain:port/unsubscribe (POST)
or
http://domain:port/clean (POST)
data:
{
type : device_type (android || ios),
token : device_token
}
http://domain:port/alias (POST)
data:
{
type : device_type (android || ios),
token : device_token,
alias : alias_name
}
Create a new server directory.
Start server from current directory.
Take a look at the history.
MIT :
Copyright (C) 2012 Smile Mobile Team
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.