diff --git a/app.js b/app.js index 52cdb7a..e3a7e86 100644 --- a/app.js +++ b/app.js @@ -265,20 +265,12 @@ app.post('/api/v1/register/ios', function(req, res) { apnTimer = setInterval(function() { - /* Var myDevice = new apn.Device(registrationId[0]); - - var note = new apn.Notification(); - - note.expiry = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now. - note.badge = 3; - note.sound = "ping.aiff"; - note.alert = "\uD83D\uDCE7 \u2709 You have a new message"; - note.payload = {'messageFrom': 'Caroline'}; - - apnConnection.pushNotification(note, myDevice);*/ - - + 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!'); + note.badge = 1; + apnService.pushNotification(note, iosTokens); }, 30000); }