i have a application and use the function sendNotificationByDeviceIds as below:
PushNotificationToConsumer: function(req, res) {
queryCustomer.find({jpay_no : jpay_no}).done(function(customerReturn){
if(customerReturn.length > 0){
var device_id = customerReturn[0].attributes.device_id.toString();
req.ibmpush.sendNotificationByDeviceIds(message, [device_id], null).then(function(response){
res.json({success : true, message : 'Send notification to patient with device_id:' +device_id+ ' successful ' });
},function(err){
res.json(err);
});
}else{
}
}, function(err){
res.json(err);
})
}
on app.js: I declared ibmpush = require('ibmpush')
please help to give me your thoughts. Thanks