diff --git a/app.js b/app.js index 2b6a72f..e6717ab 100644 --- a/app.js +++ b/app.js @@ -268,11 +268,12 @@ app.post('/api/v1/register/ios', function(req, res) { logger.info('Sending the same notification each of the devices with one call to pushNotification.'); var note = new apn.notification(); - note.setAlertText('Hello, from node-apn!'); + var now = new Date(); + note.setAlertText('Hello, from node-apn!' + now.toISOString() ); note.setAlertTitle('Smart Office'); note.setBadge(1); note.setSound('dong.aiff'); - + note.badge = 1; diff --git a/app/js/appv2.js b/app/js/appv2.js index a47dfb5..c1293ea 100644 --- a/app/js/appv2.js +++ b/app/js/appv2.js @@ -36,7 +36,7 @@ var SOController = (function() { wsUrl = 'ws://ec2-52-50-147-81.eu-west-1.compute.amazonaws.com:8080'; path = 'http://ec2-52-50-147-81.eu-west-1.compute.amazonaws.com/'; } - + MicroEvent.mixin(bus); var iOS = ['iPad', 'iPhone', 'iPod'].indexOf(navigator.platform) >= 0; @@ -329,16 +329,16 @@ var SOController = (function() { var push = PushNotification.init({"android":{},"ios":iosConfig,"windows":{}}); push.on('registration', function(d) { - console.log('Registration: ', JSON.stringify(d)); + console.log('*PUSH* Registration: ', JSON.stringify(d)); $.post(path + 'api/v1/register/ios', d, function() {}); }); push.on('notification', function(d) { - console.log('Notification: ', d); + console.log('*PUSH* Notification: ', JSON.stringify(d)); }); push.on('error', function(e) { - console.error('Push error:', e); + console.error('*PUSH* Push error:', e); }); };