node-red-contrib-ibmpush
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -33,3 +33,3 @@ /** | ||
//REMINDER: routes are order dependent | ||
// REMINDER: routes are order dependent | ||
RED.httpAdmin.get('/ibmpush/:id', function(req,res) { | ||
@@ -83,3 +83,3 @@ var credentials = RED.nodes.getCredentials(req.params.id); | ||
//read the credential(appSecret) | ||
// read the credential(appSecret) | ||
var credentials = RED.nodes.getCredentials(n.id); | ||
@@ -91,5 +91,19 @@ var applicationSecret = credentials.password; | ||
this.log("In Bluemix Environment"); | ||
vcapApplication = JSON.parse(process.env.VCAP_APPLICATION); | ||
try { | ||
vcapApplication = JSON.parse(process.env.VCAP_APPLICATION); | ||
} catch (e) { | ||
// syntax error | ||
this.error("There is no Mobile Application Security service bound to " + | ||
"this application. Please add the Mobile Application Security " + | ||
"and Push service to this application."); | ||
return null; | ||
} | ||
var vcap_app_id = vcapApplication.application_id; | ||
var vcap_app_route = vcapApplication.application_uris[0]; | ||
if (vcap_app_id == "" || vcap_app_route == "") { | ||
this.error("There is no Mobile Application Security service bound to this " + | ||
"application. Please add the Mobile Application Security and " + | ||
"Push service to this application."); | ||
return null; | ||
} | ||
if (applicationSecret == "") { | ||
@@ -96,0 +110,0 @@ this.error("The Application Secret is empty."); |
{ | ||
"name": "node-red-contrib-ibmpush", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"license": "Apache", | ||
@@ -5,0 +5,0 @@ "description": "This node can be used to push notifications to mobiles from the Node-RED flow. It uses the IBM Push service in Bluemix", |
Sorry, the diff of this file is not supported yet
35299
177