Options
All
  • Public
  • Public/Protected
  • All
Menu

Basic interface definition of Chatroom instance

Hierarchy

  • NIMChatroomInterface

Implemented by

Index

Methods

  • closeChatroom(_options: { custom: string; done?: any }): void
  • connect(): void
  • After logging out of IM using the disconnect method, you can call connect to log in again. After calling getInstance, a persistent connection will be established automatically without calling connect.

    Associated function

    Example

    chatroom.disconnect({
    done: function() {
    chatroom.connect()
    }
    })

    Returns void

  • destroy(options: { done?: any }): void
  • disconnect(options: { done?: any }): void
  • getChatroom(_options: { done?: any }): void
  • logout(): void
  • Log out

    Note: For SDK earlier than v9.6.0, it is recommended to logout first and disconnect/destroy to fully exit the chat room.. SDK v9.6.0 and later do not need to call this API, it will be called automatically before disconnect/destroy.

    Returns void

  • updateChatroom(_options: { antiSpamBusinessId?: string; chatroom: { announcement?: string; broadcastUrl?: string; custom?: string; name?: string; queuelevel?: string }; custom?: string; needNotify: boolean; done?: any }): void
  • Update the chat room profile. The server API:

    Parameters

    • _options: { antiSpamBusinessId?: string; chatroom: { announcement?: string; broadcastUrl?: string; custom?: string; name?: string; queuelevel?: string }; custom?: string; needNotify: boolean; done?: any }
      • Optional antiSpamBusinessId?: string

        Business ID for moderation

      • chatroom: { announcement?: string; broadcastUrl?: string; custom?: string; name?: string; queuelevel?: string }

        Chat room fields to be updated

        • Optional announcement?: string
          • Announcement
        • Optional broadcastUrl?: string
          • Live streaming URL
        • Optional custom?: string

          Extension field

        • Optional name?: string
          • Chat room name
        • Optional queuelevel?: string

          Queue management permissions: 0: everyone has the permission to change the queue, 1: only the anchor administrator can operate the change

      • Optional custom?: string

        extension field of notifications

      • needNotify: boolean

        Whether a notification is required.

      • done?:function

    Returns void

  • updateTags(_options: { ext?: string; needNotify?: true; notifyTargetTags?: string; tags?: string[]; done?: any }): void
  • Update the tag for the current persistent connection. If you update the tags by calling Server API, tags associated with the current persistent connection.

    Associated function

    Parameters

    • _options: { ext?: string; needNotify?: true; notifyTargetTags?: string; tags?: string[]; done?: any }
      • Optional ext?: string

        The extension field of the notification, it is recommended to use a JSON string

      • Optional needNotify?: true

        Whether a notification is required for update. Default value: false The scope of target members is determined by notifyTargetTags (note that notifyTargetTags can be configured during initialization)

      • Optional notifyTargetTags?: string

        Notification tags. Tag expression, used to notify the members who match the tags, such as the notification for members going online and offline, and updating tags. No value or an empty string indicates notifications are sent to all members.

      • Optional tags?: string[]

        Tags. * Multiple tags are supported. Subsequent tags overwrite the pervious tags. For example: ["tag1", "tag2"]. To delete tags, set the value to null. An empty array enables the tags but does not belong to any tag.

      • done?:function

    Returns void