SelectPocket PC Channel Groups API Reference for Realtime Apps

Channel Groups allows PubNub developers to bundle thousands of channels into a group that can be identified by name. These Channel Groups can then be subscribed to, receiving data from the many backend-channels the channel group contains.

Learn more about our Channel Groups here


Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function adds a channel to a channel group.
Adding Channels is accomplished by using the following method(s) in the Pocket PC SDK:
  1. ParameterTypeRequiredDescription
    channelStringYesThe channel to add to the channel group.
    groupNameStringYesThe channelGroup to add the channels to.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
  2. ParameterTypeRequiredDescription
    channelsStringYesSpecifies channelGroup to remove the channels from.
    groupNameStringYesSpecifies channelGroup to fetch the channels for.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
 string channelGroup = "family";
pubnub.AddChannelsToChannelGroup <string>(
    "wife",
    "",
    channelGroup,
    DisplayReturnMessage,
    DisplayErrorMessage
);
{
    "service" : "channel-registry",
    "status"  : 200,
    "error"   : false,
    "message" : "OK"
}

Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function lists all the channels of the channel group.
Listing Channels is accomplished by using the following method(s) in the Pocket PC SDK:
  1. ParameterTypeRequiredDescription
    groupNameStringYesSpecifies channelGroup to fetch the channels for.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
  2. ParameterTypeRequiredDescription
    groupNameStringYesSpecifies channelGroup to fetch the channels for.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
 string channelGroup = "family";
 pubnub.GetChannelsForChannelGroup<string>("", channelGroup, DisplayReturnMessage, DisplayErrorMessage);
                        

{
	"status" : 200,
	"payload" : {
		"channels" : ["hi"], 
		"group" : "abcd"
	},
	"service" : "channel-registry",
	"error" : False
}

Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function removes the channels from the channel group.
Removing Channels is accomplished by using the following method(s) in the Pocket PC SDK:
  1. ParameterTypeRequiredDescription
    channelsStringYesSpecifies channelGroup to remove the channels from.
    groupNameStringYesSpecifies channelGroup to remove the channels for.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
  2. ParameterTypeRequiredDescription
    channelsStringYesSpecifies channelGroup to remove the channels from.
    groupNameStringYesSpecifies channelGroup to fetch the channels for.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
Removing channels :
 string channelGroup = "family";
string channel = "son";
pubnub.RemoveChannelsFromChannelGroup<string>(channel.Split(','), "", "channelGroup", DisplayReturnMessage, DisplayErrorMessage);

{
	"status" : 200,
	"message" : "OK",
	"service" : "channel-registry",
	"error" : False
}

Requires Stream Controller add-on XRequires that the Stream Controller add-on is enabled for your key. See this page on enabling add-on features on your keys:

http://www.pubnub.com/knowledge-base/discussion/644/how-do-i-enable-add-on-features-for-my-keys.
This function removes the channel group.
Deleting Channel Group is accomplished by using the following method(s) in the Pocket PC SDK:
  1. ParameterTypeRequiredDescription
    nameSpaceStringYespass as empty string
    groupNameStringYesSpecifies channelGroup to remove.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
  2. ParameterTypeRequiredDescription
    nameSpacestringYespass as empty string
    groupNamestringYesSpecifies channelGroup to fetch the channels for.
    userCallbackCallback Method of Type TYesThis callback is called on success event.
    errorCallbackCallback Method of Type PubnubClientError YesThis callback is called on an error event.
Deleting Channel Group :
 string channelGroup = "family";
pubnub.RemoveChannelGroup <string>(
    nameSpace: "",
    groupName: "my_channelgroup",
    DisplayReturnMessage,
    DisplayErrorMessage
);
// NOTE: DisplayReturnMessage and DisplayErrorMessage are callback methods

{
	"status" : 200,
	"message" : "OK",
	"service" : "channel-registry",
	"error" : False
}