Packagecom.smartfoxserver.v2.requests
Classpublic class UnsubscribeRoomGroupRequest
InheritanceUnsubscribeRoomGroupRequest Inheritance com.smartfoxserver.v2.requests.BaseRequest

Unsubscribes the current user to Room-related events occurring in the specified Group. This 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.

View the examples

See also

roomGroupUnsubscribe event
roomGroupUnsubscribeError event
SubscribeRoomGroupRequest


Public Methods
 MethodDefined By
  
Creates a new UnsubscribeRoomGroupRequest instance.
UnsubscribeRoomGroupRequest
Constructor Detail
UnsubscribeRoomGroupRequest()Constructor
public function UnsubscribeRoomGroupRequest(groupId:String)

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

Parameters
groupId:String — The name of the Room Group to unsubscribe.

See also

Examples
The following example makes the current user unsubscribe a Group:
     
     private function someMethod():void
     {
         sfs.addEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE, onGroupUnsubscribed);
         sfs.addEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR, onGroupUnsubscribeError);
         
         // Unsubscribe the "cardGames" group
         sfs.send(new UnsubscribeRoomGroupRequest("cardGames"));
     }
     
     private function onGroupUnsubscribed(evt:SFSEvent):void
     {
         trace("Group unsubscribed: " + evt.params.groupId);
     }
     
     private function onGroupUnsubscribeError(evt:SFSEvent):void
     {
         trace("Group unsubscribing failed: " + evt.params.errorMessage);
     }