How to use the pubnub.channel_group_add_channel function in pubnub

To help you get started, we’ve selected a few pubnub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pubnub / angularjs-hubbub / server / app.js View on Github external
var createOwnUserFriendsPresenceChannelGroup = function(user, friends){

      var deferred = Q.defer();
        
      var friends_presence_channels = _.map(friends, function(friend){ return "user_presence_" + friend.id });
      var user_friends_presence_channel = 'friends_presence_' + user._id

      pubnub.channel_group_add_channel({
        callback: function(res){ deferred.resolve(res) },
        error: function(res){ deferred.reject(res) },
        channel_group: user_friends_presence_channel,
        channel: friends_presence_channels
      }); 

      return deferred.promise;

  }

pubnub

Publish & Subscribe Real-time Messaging with PubNub

SEE LICENSE IN LICENSE
Latest version published 3 days ago

Package Health Score

86 / 100
Full package analysis