Apple Push notifications. Trying something else. again

This commit is contained in:
Martin Donnelly 2016-04-29 11:08:13 +01:00
parent b66a9f3650
commit f1ce8a1171

18
app.js
View File

@ -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);
}