|
|
@ -98,12 +98,13 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio |
|
|
|
var notifType = PUSHNOTIFICATIONS_TYPES[notification.type]; |
|
|
|
if (!notifType) return cb(); |
|
|
|
|
|
|
|
log.debug('\n### Notification received\n', JSON.stringify(notification)); |
|
|
|
log.debug('### Notification received: ' + notification.type); |
|
|
|
log.debug(JSON.stringify(notification)); |
|
|
|
|
|
|
|
self._checkShouldSendNotif(notification, function(err, should) { |
|
|
|
if (err) return cb(err); |
|
|
|
|
|
|
|
log.debug('\nShould send notification: ', should); |
|
|
|
log.debug('Should send notification: ', should); |
|
|
|
if (!should) return cb(); |
|
|
|
|
|
|
|
self._getRecipientsList(notification, function(err, recipientsList) { |
|
|
@ -137,8 +138,8 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio |
|
|
|
async.each(optsList, |
|
|
|
function(opts, next) { |
|
|
|
self._makeRequest(opts, function(err, response) { |
|
|
|
if (err) log.error('ERROR!: ', err); |
|
|
|
log.debug('Request status : ', response); |
|
|
|
if (err) log.error(err); |
|
|
|
if (response) log.debug('Request status : ', response.statusCode); |
|
|
|
next(); |
|
|
|
}); |
|
|
|
}, |
|
|
|