Example #1
0
NotificationManager.prototype._createChannel = function(vin) {
  
  var channelName = _getChannelName(vin); 
  var response = pubsub.getChannel(channelName);
  if (response.metadata.status == "failure") {
    var res = pubsub.createChannel(channelName);
  }
  
  return channelName;
};
Example #2
0
NotificationManager.prototype._createChannel = function(username, carId) {
  
  var channelName = this._getChannelName(username, carId);
  var response = pubsub.getChannel(channelName);
  if (response.metadata.status == "failure") {
    var res = pubsub.createChannel(channelName);
    console.log(JSON.stringify(res));
  }
  
  return channelName;
};