Glavin001 / SMMApp2

Saint Mary's Mobile App, Version 2.0 @
http://society.cs.smu.ca:7000
2 stars 0 forks source link

"Pull"/Receive Notifications #52

Open Glavin001 opened 10 years ago

Glavin001 commented 10 years ago

Implement the Observer Pattern such that modules can observe notification events that are received from a user, such as Twilio SMS or Email.

For example:

var NotificationCenter = require("./notification-center");

// Listen for an Event, received SMS
NotificationCenter.on("sms", function(event) {
   // Event occurred  
   // Process SMS (Text message)
   // Potentially reply
   NotificationCenter.send(event.sender, ....);
});
// Listen for an Event, received Email
NotificationCenter.on("email", function(event) {
   // Event occurred  
   // Process Email
   // Potentially reply
   NotificationCenter.send(event.sender, ....);
});

Related to #10.