3 var gcm = require('node-gcm');
4 var notificationMessageGenerator = require('../notification-message-generator');
6 function generateNewChatNotifications(notificationType, notificationDetails /*, device*/) {
7 var room = notificationDetails.room;
8 var chats = notificationDetails.chats;
9 var message = notificationMessageGenerator(room, chats);
11 return new gcm.Message({
14 name: room.name || room.uri,
15 message: message // Still used on Android
20 function generateNotifications(notificationType, notificationDetails, device) {
21 switch (notificationType) {
23 return generateNewChatNotifications(notificationType, notificationDetails, device);
27 module.exports = generateNotifications;