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

Namespace: Sfs2X.Requests
Assembly: SmartFox2X (in SmartFox2X.dll) Version: (1.7.3)


public class UnsubscribeRoomGroupRequest : BaseRequest


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 ROOM_GROUP_UNSUBSCRIBE event; otherwise the ROOM_GROUP_UNSUBSCRIBE_ERROR event is fired.


The following example makes the current user unsubscribe a Group:
 Copy imageCopy
void SomeMethod() {
    sfs.AddEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE, OnUnsubscribeRoomGroup);
    sfs.AddEventListener(SFSEvent.ROOM_GROUP_UNSUBSCRIBE_ERROR, OnUnsubscribeRoomGroupError);
    // Unsubscribe the "card_games" group
    sfs.Send( new UnsubscribeRoomGroupRequest("card_games") );
void OnUnsubscribeRoomGroup(BaseEvent evt) {
    Console.WriteLine("Group unsubscribed: " + (string)evt.Params["groupId"]);                          // .Net / Unity
    System.Diagnostics.Debug.WriteLine("Group unsubscribed: " + (string)evt.Params["groupId"]);         // Windows Universal
void OnUnsubscribeRoomGroupError(BaseEvent evt) {
    Console.WriteLine("Group unsubscribing failed: " + (string)evt.Params["errorMessage"]);                         // .Net / Unity
    System.Diagnostics.Debug.WriteLine("Group unsubscribing failed: " + (string)evt.Params["errorMessage"]);        // Windows Universal

Inheritance Hierarchy


See Also