Push notifications used wrong id.

This commit is contained in:
Martin Donnelly 2016-04-29 09:48:34 +01:00
parent 306781c03d
commit ec6cecd270

11
app.js
View File

@ -216,15 +216,16 @@ app.post('/api/v1/projector/on', projector_v1.turnon);
app.post('/api/v1/register/ios', function(req, res) {
var body = req.body;
var body = req.body, registrationId;
logger.debug(body);
if (body.hasOwnProperty(id)) {
logger.debug(body.id);
if (body.hasOwnProperty('registrationId')) {
registrationId = body['registrationId'];
logger.debug(registrationId);
if (iosTokens.indexOf(body.id) === -1) {
iosTokens.push(body.id);
if (iosTokens.indexOf(registrationId) === -1) {
iosTokens.push(registrationId);
logger.info('IOS Device registered.');
}