Options
All
  • Public
  • Public/Protected
  • All
Menu

RongIMLib - v5.9.0

Index

Enum

Interface

其他

其他

EnableLogL: DEBUG | INFO | WARN | ERROR

有效的日志等级声明

IEventListener: ((...args: any[]) => void)

Type declaration

    • (...args: any[]): void
    • Parameters

      • Rest ...args: any[]

      Returns void

IRemoveChatRoomEntryOption: IRemoveChatroomEntry
deprecated
RTCRoomOption: { id: string; roomId: string; mode: RTCMode; broadcastType: number }

Type declaration

  • id: string
  • roomId: string
  • mode: RTCMode
  • broadcastType: number
ICallLibReceivedMsgListener: { onReceived?: any }

Type declaration

RongIMClient: { init: any; getInstance: any; setConnectionStatusListener: any; onConnectionStatusChange: any; setOnReceiveMessageListener: any; setConversationStatusListener: any; setMessageExpansionListener: any; setTagListener: any; setConversationTagListener: any; setPullOffLineFinished: any; setTypingStatusListener: any; setMessageBlockedListener: any; setChatRoomStatusListener: any; setMessageDeliveredListener: any; setGroupMessageDeliveredStatusListener: any; connect: any; reconnect: any; RegisterMessage: {}; RegisterMessageTypeMapping: {}; getMessageObjectName: any; registerMessageType: any }

Type declaration

  • init:function
    • init(appkey: string, _: void, options?: IInitOption): void
    • 初始化 IM SDK

      Parameters

      • appkey: string
      • _: void

        该参数已废弃,为保持向前兼容,保留占位参数

      • options: IInitOption = {}

      Returns void

  • getInstance:function
    • 单例模式,用于获取 IMClient 实例

      Returns IMClient

  • setConnectionStatusListener:function
    • deprecated

      请使用 onConnectionStatusChange 替代该方法

      Parameters

      Returns never

  • onConnectionStatusChange:function
    • 添加连接监听器

      Parameters

      Returns void

  • setOnReceiveMessageListener:function
    • 添加消息监听器

      Parameters

      Returns void

  • setConversationStatusListener:function
  • setMessageExpansionListener:function
    • 消息扩展监听

      Parameters

      Returns void

  • setTagListener:function
    • tag监听

      Parameters

      Returns void

  • setConversationTagListener:function
    • 会话中tag状态监听

      Parameters

      Returns void

  • setPullOffLineFinished:function
    • 用于拉取完毕监听

      Parameters

      Returns void

  • setTypingStatusListener:function
    • typing监听

      Parameters

      Returns void

  • setMessageBlockedListener:function
    • 敏感词监听

      Parameters

      Returns void

  • setChatRoomStatusListener:function
    • 聊天室信息监听

      Parameters

      Returns void

  • setMessageDeliveredListener:function
    • setMessageDeliveredListener(listenner: IMessageDeliveredListener): void
    • 消息送达监听

      Parameters

      • listenner: IMessageDeliveredListener

      Returns void

  • setGroupMessageDeliveredStatusListener:function
    • setGroupMessageDeliveredStatusListener(listenner: IGroupMessageDeliveredStatusListener): void
    • 群组消息送达状态监听

      Parameters

      • listenner: IGroupMessageDeliveredStatusListener

      Returns void

  • connect:function
    • connect(token: string, callback: IConnectCallback, reconnectKickEnable?: boolean): Promise<void>
    • 连接 IM 服务

      Parameters

      • token: string

        用于连接鉴权

      • callback: IConnectCallback

        连接状态回调

      • Optional reconnectKickEnable: boolean

      Returns Promise<void>

  • reconnect:function
    • 重连 im 服务

      description

      Web IM 3.0 开始 SDK 内部会进行自动重连,不需要主动调用此方法。此方法建议主动断开连接后,再次链接时调用。

      Parameters

      Returns void

  • RegisterMessage: {}
  • RegisterMessageTypeMapping: {}
    • [key: string]: string
  • getMessageObjectName:function
    • getMessageObjectName(messageType: string): string
    • 根据 messageType 获取对应的消息 objectName 值 若无记录,则返回原字符串

      todo

      优化算法

      Parameters

      • messageType: string

      Returns string

  • registerMessageType:function
    • registerMessageType(messageType: string, objectName: string, mesasgeTag: MessageTag, searchProps: string[]): void
    • 注册自定义消息

      Parameters

      • messageType: string

        v2 中定义的消息类型,如:TextMessage

      • objectName: string

        与移动端对齐的消息结构类型,如:RC:TxtMsg

      • mesasgeTag: MessageTag

        是否存储或计数标记

      • searchProps: string[]

        消息属性名称列表

      Returns void

ConnectionState: { ACCEPTED: number; UNACCEPTABLE_PROTOCOL_VERSION: number; IDENTIFIER_REJECTED: number; SERVER_UNAVAILABLE: number; TOKEN_INCORRECT: number; NOT_AUTHORIZED: number; REDIRECT: number; PACKAGE_ERROR: number; APP_BLOCK_OR_DELETE: number; BLOCK: number; TOKEN_EXPIRE: number; DEVICE_ERROR: number; HOSTNAME_ERROR: number; HASOHTERSAMECLIENTONLINE: number; OUT_OF_LIMIT: number; IN_OTHER_CLUSTER: number; APP_AUTH_NOT_PASS: number; OTP_USED: number; PLATFORM_ERROR: number; USER_LOGOUT: number; ACCOUNT_CANCELLATION: number; LICENSE_EXPIRED: number } = ...

连接应答码

deprecated

Type declaration

  • ACCEPTED: number

    连接成功

  • UNACCEPTABLE_PROTOCOL_VERSION: number

    协议版本不匹配

    description

    暂未使用

  • IDENTIFIER_REJECTED: number

    客户端(移动端 TCP 连接建立时)info 字段格式错误

    description

    格式:{平台类型}-{设备信息}-{sdk版本}。 其中设备信息为:{手机类型}{手机型号}{网络类型,4G/WIFI}{运营商标识, 移动/电信/联通}

  • SERVER_UNAVAILABLE: number

    不支持的平台类型,一般小程序或 PC 未开通

  • TOKEN_INCORRECT: number

    Token 无法解析,或 Token 已过期

  • NOT_AUTHORIZED: number

    防黑产规则相关应答

  • REDIRECT: number

    服务重定向,一般服务扩缩容时,落点已经改变,此时 userId 链接到旧的节点时,会触发该错误。 客户端收到该应答后须重新访问导航,重新获取 CMP 地址

  • PACKAGE_ERROR: number

    包名不合法(移动端使用)

  • APP_BLOCK_OR_DELETE: number

    该 AppKey 已经封禁或删除

  • BLOCK: number

    该用户 ID 已经被封禁

  • TOKEN_EXPIRE: number

    Token 已过期,暂未使用

  • DEVICE_ERROR: number

    Token 中携带 deviceId 时,检测 Token 中 deviceId 与链接设备 deviceId 不一致

  • HOSTNAME_ERROR: number

    Web 端设置安全域名后,连接端域名不在安全域名范围内

  • HASOHTERSAMECLIENTONLINE: number

    开启禁止把已在线客户端踢下线开关后,该错误码标识已有同类型端在线,禁止链接

  • OUT_OF_LIMIT: number

    (私有云) 连接数已达授权上限

  • IN_OTHER_CLUSTER: number

    客户端连错环境,引发连接拒绝

  • APP_AUTH_NOT_PASS: number

    开启 AppServer 联合鉴权功能后,到 AppServer 认证失败

  • OTP_USED: number

    One Time Password 已经被使用过

  • PLATFORM_ERROR: number

    Token 绑定的平台与登录平台不符

  • USER_LOGOUT: number

    用户账号已销户,不再进行连接

    deprecated

    使用 ACCOUNT_CANCELLATION 替代

  • ACCOUNT_CANCELLATION: number

    用户账号已销户,不再进行连接

  • LICENSE_EXPIRED: number

    License 授权过期

RCCombineMessage: (new (content: CombineMessageOptions) => BaseMessage<CombineMessageOptions>)

Type declaration

    • new (content: CombineMessageOptions): BaseMessage<CombineMessageOptions>
    • Parameters

      • content: CombineMessageOptions

      Returns BaseMessage<CombineMessageOptions>

FileMessage: (new (content: FileMessageOptions) => BaseMessage<FileMessageOptions>)

Type declaration

    • new (content: FileMessageOptions): BaseMessage<FileMessageOptions>
    • Parameters

      • content: FileMessageOptions

      Returns BaseMessage<FileMessageOptions>

GIFMessage: (new (content: GIFMessageOptions) => BaseMessage<GIFMessageOptions>)

Type declaration

    • new (content: GIFMessageOptions): BaseMessage<GIFMessageOptions>
    • Parameters

      • content: GIFMessageOptions

      Returns BaseMessage<GIFMessageOptions>

HQVoiceMessage: (new (content: HQVoiceMessageOptions) => BaseMessage<HQVoiceMessageOptions>)

Type declaration

    • new (content: HQVoiceMessageOptions): BaseMessage<HQVoiceMessageOptions>
    • Parameters

      • content: HQVoiceMessageOptions

      Returns BaseMessage<HQVoiceMessageOptions>

ImageMessage: (new (content: ImageMessageOptions) => BaseMessage<ImageMessageOptions>)

Type declaration

    • new (content: ImageMessageOptions): BaseMessage<ImageMessageOptions>
    • Parameters

      • content: ImageMessageOptions

      Returns BaseMessage<ImageMessageOptions>

LocationMessage: (new (content: LocationMessageContent) => BaseMessage<LocationMessageContent>)

Type declaration

    • new (content: LocationMessageContent): BaseMessage<LocationMessageContent>
    • Parameters

      • content: LocationMessageContent

      Returns BaseMessage<LocationMessageContent>

PublicServiceMultiRichContentMessage: (new (content: IPSMessageContent) => BaseMessage<IPSMessageContent>)

Type declaration

    • new (content: IPSMessageContent): BaseMessage<IPSMessageContent>
    • Parameters

      • content: IPSMessageContent

      Returns BaseMessage<IPSMessageContent>

PublicServiceRichContentMessage: (new (content: IPSMessageContent) => BaseMessage<IPSMessageContent>)

Type declaration

    • new (content: IPSMessageContent): BaseMessage<IPSMessageContent>
    • Parameters

      • content: IPSMessageContent

      Returns BaseMessage<IPSMessageContent>

ReadReceiptMessage: (new (content: ReadReceiptMessageContent) => BaseMessage<ReadReceiptMessageContent>)

Type declaration

    • new (content: ReadReceiptMessageContent): BaseMessage<ReadReceiptMessageContent>
    • Parameters

      • content: ReadReceiptMessageContent

      Returns BaseMessage<ReadReceiptMessageContent>

ReadReceiptRequestMessage: (new (content: ReadReceiptRequestMessageContent) => BaseMessage<ReadReceiptRequestMessageContent>)

Type declaration

    • new (content: ReadReceiptRequestMessageContent): BaseMessage<ReadReceiptRequestMessageContent>
    • Parameters

      • content: ReadReceiptRequestMessageContent

      Returns BaseMessage<ReadReceiptRequestMessageContent>

ReadReceiptResponseMessage: (new (content: ReadReceiptResponseMessageContent) => BaseMessage<ReadReceiptResponseMessageContent>)

Type declaration

    • new (content: ReadReceiptResponseMessageContent): BaseMessage<ReadReceiptResponseMessageContent>
    • Parameters

      • content: ReadReceiptResponseMessageContent

      Returns BaseMessage<ReadReceiptResponseMessageContent>

ReferenceMessage: (new (content: ReferenceMessageContent) => BaseMessage<ReferenceMessageContent>)

Type declaration

    • new (content: ReferenceMessageContent): BaseMessage<ReferenceMessageContent>
    • Parameters

      • content: ReferenceMessageContent

      Returns BaseMessage<ReferenceMessageContent>

RichContentMessage: (new (content: RichContentMessageOptions) => BaseMessage<RichContentMessageOptions>)

Type declaration

    • new (content: RichContentMessageOptions): BaseMessage<RichContentMessageOptions>
    • Parameters

      • content: RichContentMessageOptions

      Returns BaseMessage<RichContentMessageOptions>

SightMessage: (new (content: SightMessageOptions) => BaseMessage<SightMessageOptions>)

Type declaration

    • new (content: SightMessageOptions): BaseMessage<SightMessageOptions>
    • Parameters

      • content: SightMessageOptions

      Returns BaseMessage<SightMessageOptions>

SyncReadStatusMessage: (new (content: SyncReadStatusMessage) => BaseMessage<SyncReadStatusMessage>)

Type declaration

    • new (content: SyncReadStatusMessage): BaseMessage<SyncReadStatusMessage>
    • Parameters

      • content: SyncReadStatusMessage

      Returns BaseMessage<SyncReadStatusMessage>

TextMessage: (new (content: TextMessageContent) => BaseMessage<TextMessageContent>)

Type declaration

    • new (content: TextMessageContent): BaseMessage<TextMessageContent>
    • 文本消息

      Parameters

      • content: TextMessageContent

      Returns BaseMessage<TextMessageContent>

TypingStatusMessage: (new (content: TypingStatusMessageOptions) => BaseMessage<TypingStatusMessageOptions>)

Type declaration

    • new (content: TypingStatusMessageOptions): BaseMessage<TypingStatusMessageOptions>
    • Parameters

      • content: TypingStatusMessageOptions

      Returns BaseMessage<TypingStatusMessageOptions>

AcceptMessage: (new (content: AcceptMessageOption) => BaseMessage<AcceptMessageOption>) = ...

Type declaration

    • new (content: AcceptMessageOption): BaseMessage<AcceptMessageOption>
    • Parameters

      • content: AcceptMessageOption

      Returns BaseMessage<AcceptMessageOption>

RingingMessage: (new (content: RingingMessageOption) => BaseMessage<RingingMessageOption>) = ...

Type declaration

    • new (content: RingingMessageOption): BaseMessage<RingingMessageOption>
    • Parameters

      • content: RingingMessageOption

      Returns BaseMessage<RingingMessageOption>

SummaryMessage: (new (content: SummaryMessageOptions) => BaseMessage<SummaryMessageOptions>) = ...

Type declaration

    • new (content: SummaryMessageOptions): BaseMessage<SummaryMessageOptions>
    • Parameters

      • content: SummaryMessageOptions

      Returns BaseMessage<SummaryMessageOptions>

HungupMessage: (new (content: HungupMessageOptions) => BaseMessage<HungupMessageOptions>) = ...

Type declaration

    • new (content: HungupMessageOptions): BaseMessage<HungupMessageOptions>
    • Parameters

      • content: HungupMessageOptions

      Returns BaseMessage<HungupMessageOptions>

InviteMessage: (new (content: InviteMessageOptions) => BaseMessage<InviteMessageOptions>) = ...

Type declaration

    • new (content: InviteMessageOptions): BaseMessage<InviteMessageOptions>
    • Parameters

      • content: InviteMessageOptions

      Returns BaseMessage<InviteMessageOptions>

MediaModifyMessage: (new (content: MediaModifyMessageOptions) => BaseMessage<MediaModifyMessageOptions>) = ...

Type declaration

    • new (content: MediaModifyMessageOptions): BaseMessage<MediaModifyMessageOptions>
    • Parameters

      • content: MediaModifyMessageOptions

      Returns BaseMessage<MediaModifyMessageOptions>

MemberModifyMessage: (new (content: MemberModifyMessageOptions) => BaseMessage<MemberModifyMessageOptions>) = ...

Type declaration

    • new (content: MemberModifyMessageOptions): BaseMessage<MemberModifyMessageOptions>
    • Parameters

      • content: MemberModifyMessageOptions

      Returns BaseMessage<MemberModifyMessageOptions>

VoiceMessage: (new (content: VoiceMessageOptions) => BaseMessage<VoiceMessageOptions>)

Type declaration

    • new (content: VoiceMessageOptions): BaseMessage<VoiceMessageOptions>
    • Parameters

      • content: VoiceMessageOptions

      Returns BaseMessage<VoiceMessageOptions>