aerogear-sender-client
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -14,7 +14,9 @@ var agSender = require( "./lib/aerogear-sender-client" ).AeroGear, | ||
applicationID: "aa3cfaad-8cd4-4b3c-af23-08417b879d00", | ||
masterSecret: "SHHHHHH", | ||
masterSecret: "shhh", | ||
ttl: 3600, | ||
"simple-push": { | ||
"broadcast": "version="+ new Date().getTime() + "" | ||
}, | ||
criteria: { | ||
"simple-push": { | ||
"broadcast": "version="+ new Date().getTime() + "" | ||
} | ||
variants: [ "1234", "56788" ] | ||
} | ||
@@ -21,0 +23,0 @@ }; |
@@ -24,2 +24,3 @@ /* Node.js Sender API for the AeroGear Unified Push server | ||
function send( serverSettings, message ) { | ||
console.log( message ); | ||
@@ -117,2 +118,4 @@ // we stash the 'https' module on a local variable, IF the server is deployed using SSL. | ||
@param {String} settings.masterSecret - The Master Secret | ||
@param {Object} [settings.simple-push] - an object containing simple-push criteria | ||
@param {Number} [settings.ttl] - the time to live in seconds. This value is supported by APNs and GCM Only | ||
@param {Object} [settings.criteria={}] - the criteria to select | ||
@@ -123,4 +126,2 @@ @param {Array} [settings.criteria.alias] - a list of email or name strings | ||
@param {Array} [settings.criteria.variants] - a list of variantID's as strings | ||
@param {Number} [settings.criteria.ttl] - the time to live in seconds. This value is supported by APNs and GCM Only | ||
@param {Object} [settings.criteria.simple-push] - an object containing simple-push criteria | ||
@returns {Object} itself | ||
@@ -133,9 +134,16 @@ | ||
var serverSettings, | ||
var serverSettings, setting, crit, | ||
url = urlParser.parse( this.getUrl() ), | ||
newMessage = {}; | ||
if( settings.criteria ) { | ||
for( var crit in settings.criteria ) { | ||
newMessage[ crit ] = settings.criteria[ crit ]; | ||
for( setting in settings ) { | ||
if( setting !== "applicationID" && setting !== "masterSecret" ) | ||
{ | ||
if( setting === "criteria" ) { | ||
for( crit in settings.criteria ) { | ||
newMessage[ crit ] = settings.criteria[ crit ]; | ||
} | ||
} else { | ||
newMessage[ setting ] = settings[ setting ]; | ||
} | ||
} | ||
@@ -142,0 +150,0 @@ } |
{ | ||
"name": "aerogear-sender-client", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Sender api for the AeroGear Unified Push server", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/aerogear/aerogear-unifiedpush-nodejs-client", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127980
4777