Class SFS2X.Requests.System.UnsubscribeRoomGroupRequest

Unsubscribes the current user to Room-related events occurring in the specified Group.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a new UnsubscribeRoomGroupRequest instance.

Class Detail

SFS2X.Requests.System.UnsubscribeRoomGroupRequest(groupId)
Creates a new UnsubscribeRoomGroupRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.

This request allows the user to stop being notified of specific Room events occurring in Rooms belonging to the unsubscribed Group.
If the operation is successful, the current user receives a roomGroupUnsubscribe event; otherwise the roomGroupUnsubscribeError event is fired.

The following example makes the current user unsubscribe a Group:

function someMethod()
{
	sfs.addEventListener(SFS2X.SFSEvent.ROOM_GROUP_UNSUBSCRIBE, onGroupUnsubscribed, this);
	sfs.addEventListener(SFS2X.SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR, onGroupUnsubscribeError, this);
	
	// Unsubscribe the "cardGames" group
	sfs.send(new SFS2X.Requests.System.UnsubscribeRoomGroupRequest("cardGames"));
}

function onGroupUnsubscribed(evtParams)
{
	console.log("Group unsubscribed: " + evtParams.groupId);
}

function onGroupUnsubscribeError(evtParams)
{
	console.log("Group unsubscribing failed: " + evtParams.errorMessage);
}
Parameters:
{String} groupId
The name of the Room Group to unsubscribe.
See also:
SFS2X.SmartFox#send
SFS2X.Entities.SFSRoom#groupId
SFS2X.SFSEvent.ROOM_GROUP_UNSUBSCRIBE
SFS2X.SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR
SFS2X.Requests.System.SubscribeRoomGroupRequest