Class OpenChannel

  • All Implemented Interfaces:

    
    public final class OpenChannel
    extends BaseChannel
                        

    Open channel.

    A large-scale public channel similar to a chatroom, supporting a large number of concurrent participants. Users can create, enter, and leave open channels freely.

    Inherits from BaseChannel and supports message querying and unread count management.

    • Constructor Detail

      • OpenChannel

        OpenChannel(String channelId)
    • Method Detail

      • enterChannel

         final Unit enterChannel(EnterOpenChannelParams params, ErrorHandler handler)

        Enters (joins) this open channel.

        After entering, the user can send and receive messages. Fails if the channel does not exist.

        Parameters:
        params - Enter channel parameters including message count and extra info
        handler - Error callback; null error indicates success
      • exitChannel

         final Unit exitChannel(String extra, ErrorHandler handler)

        Exits (leaves) this open channel.

        After exiting, the user will no longer receive messages from this channel.

        Parameters:
        extra - Additional information to send when exiting the channel
        handler - Error callback; null error indicates success
      • getMetadata

         final Unit getMetadata(String key, OperationHandler<Map<String, String>> handler)

        Gets metadata for this open channel by key.

        Note: The chatroom status storage feature must be enabled first.

        Parameters:
        key - The metadata key
        handler - Callback returning the key-value pair on success
      • setMetadata

         final Unit setMetadata(OpenChannelSetMetadataParams params, ErrorHandler handler)

        Sets metadata for this open channel.

        Parameters:
        params - Metadata parameters including entries, delete-when-left flag, and overwrite flag
        handler - Error callback; null error indicates success