RongCloud React Native IM Wrapper - v5.12.1
    Preparing search index...

    Class RCIMIWEngine

    Index

    Constructors

    Properties

    Methods

    create destroy setDeviceToken registerNativeCustomMessage registerNativeCustomMediaMessage connect disconnect createTextMessage createImageMessage createFileMessage createSightMessage createVoiceMessage createReferenceMessage createGIFMessage createCustomMessage createLocationMessage createNativeCustomMessage createNativeCustomMediaMessage sendMessage sendMediaMessage cancelSendingMediaMessage downloadMediaMessage cancelDownloadingMediaMessage getConversation getConversations getUnreadConversations removeConversation removeConversations getUnreadCount getTotalUnreadCount getUnreadMentionedCount getUltraGroupAllUnreadCount getUltraGroupAllUnreadMentionedCount getUltraGroupUnreadCount getUltraGroupUnreadMentionedCount getUnreadCountByConversationTypes clearUnreadCount saveDraftMessage getDraftMessage clearDraftMessage getBlockedConversations changeConversationTopStatus getConversationTopStatus syncConversationReadStatus sendTypingStatus getMessages getMessageById getMessageByUId getFirstUnreadMessage getUnreadMentionedMessages insertMessage insertMessages clearMessages deleteLocalMessages deleteMessages recallMessage sendPrivateReadReceiptMessage sendGroupReadReceiptRequest sendGroupReadReceiptResponse updateMessageExpansion removeMessageExpansionForKeys changeMessageSentStatus changeMessageReceiveStatus joinChatRoom leaveChatRoom getChatRoomMessages addChatRoomEntry addChatRoomEntries getChatRoomEntry getChatRoomAllEntries removeChatRoomEntry removeChatRoomEntries addToBlacklist removeFromBlacklist getBlacklistStatus getBlacklist searchMessages searchMessagesByTimeRange searchMessagesByUserId searchConversations changeNotificationQuietHours removeNotificationQuietHours getNotificationQuietHours changeConversationNotificationLevel getConversationNotificationLevel changeConversationTypeNotificationLevel getConversationTypeNotificationLevel changeUltraGroupDefaultNotificationLevel getUltraGroupDefaultNotificationLevel changeUltraGroupChannelDefaultNotificationLevel getUltraGroupChannelDefaultNotificationLevel changePushContentShowStatus changePushLanguage changePushReceiveStatus sendGroupMessageToDesignatedUsers getMessageCount getTopConversations syncUltraGroupReadStatus getConversationsForAllChannel modifyUltraGroupMessage recallUltraGroupMessage clearUltraGroupMessages sendUltraGroupTypingStatus clearUltraGroupMessagesForAllChannel getBatchRemoteUltraGroupMessages updateUltraGroupMessageExpansion removeUltraGroupMessageExpansionForKeys changeLogLevel getDeltaTime createTag removeTag updateTagNameById getTags addConversationToTag removeConversationFromTag removeTagsFromConversation getTagsFromConversation getConversationsFromTagByPage getUnreadCountByTag changeConversationTopStatusInTag getConversationTopStatusInTag clearMessagesUnreadStatusByTag clearConversationsByTag setOnMessageReceivedListener setOnConnectionStatusChangedListener setOnConversationTopStatusSyncedListener setOnConversationNotificationLevelSyncedListener setOnRemoteMessageRecalledListener setOnPrivateReadReceiptReceivedListener setOnRemoteMessageExpansionUpdatedListener setOnRemoteMessageExpansionForKeyRemovedListener setOnChatRoomMemberChangedListener setOnTypingStatusChangedListener setOnConversationReadStatusSyncMessageReceivedListener setOnChatRoomEntriesSyncedListener setOnChatRoomEntriesChangedListener setOnRemoteUltraGroupMessageExpansionUpdatedListener setOnRemoteUltraGroupMessageModifiedListener setOnRemoteUltraGroupMessageRecalledListener setOnUltraGroupReadTimeReceivedListener setOnUltraGroupTypingStatusChangedListener setOnMessageBlockedListener setOnChatRoomStatusChangedListener setOnGroupMessageReadReceiptRequestReceivedListener setOnGroupMessageReadReceiptResponseReceivedListener setOnUltraGroupConversationsSyncedListener setOnChatRoomJoiningListener

    Constructors

    Properties

    _instance: RCIMIWEngine

    Methods

    • 销毁引擎 引擎销毁后如果当前未退出登录,SDK 会自动退出,且仍接受 push

      Returns Promise<number>

    • Parameters

      • deviceToken: string

      Returns Promise<number>

    • Register native custom message

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success, non-zero indicates failure. Refer to error codes for details

    • Register native custom media message

      Parameters

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, non-zero indicates failure. Refer to error codes for details

    • Connect to RC server. Call this once globally in your app. If a non-business error code is returned, the SDK will retry. If still unsuccessful, it will retry when the device’s network status changes.

      Parameters

      • token: string

        Token obtained from the server API

      • timeout: number

        Connection timeout in seconds. If timeLimit ≤ 0, IM will keep trying until success or failure (e.g., invalid token). If timeLimit > 0, IM will try for up to timeLimit seconds. If connected within timeLimit, the SDK will auto-reconnect on network changes or app state changes. If not connected within timeLimit, the listener will notify timeout, and you’ll need to call connect again.

      • Optionalcallback: RCIMIWConnectCallback

        Connection event callback. Supported since SDK 5.3.1. Other callback methods are deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success, and the result is handled in the callback. Non-zero means failure, and no callback will be triggered. Check error codes for details.

    • Disconnect link Note: The SDK automatically reconnects during app state changes or network issues to ensure reliability. Only call this method if your app logic requires logout.

      Parameters

      • receivePush: boolean

        Whether to receive push after disconnecting. true: receive remote push, false: stop receiving remote push

      Returns Promise<number>

      Status code of the operation. 0 indicates success, with results in the callback. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for details.

    • Build a text message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types.

      • text: string

        Text content

      Returns Promise<RCIMIWTextMessage>

      Text message entity

    • Build an image message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types.

      • path: string

        Local path of the image message, must be valid

      Returns Promise<RCIMIWImageMessage>

      Image message entity

    • Build a file message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups, pass null for other conversation types

      • path: string

        Local path of the file message, must be a valid path

      Returns Promise<RCIMIWFileMessage>

      File message entity

    • Build a short video message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types.

      • path: string

        Local path of the short video message. Must be valid.

      • duration: number

        Duration of the short video message

      Returns Promise<RCIMIWSightMessage>

      Video message entity

    • Build a voice message (HD voice)

      Parameters

      • type: RCIMIWConversationType

        Session type

      • targetId: string

        Session ID

      • channelId: string

        Channel ID, only supported for super groups. Pass null for other session types.

      • path: string

        Local path of the voice message, must be valid

      • duration: number

        Duration of the voice message

      Returns Promise<RCIMIWVoiceMessage>

      Voice message entity

    • Build a reference message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only for supergroups. Pass null for other conversation types.

      • referenceMessage: RCIMIWMessage

        Referenced message

      • text: string

        Referenced text content

      Returns Promise<RCIMIWReferenceMessage>

      Reference message entity

    • Build a GIF message

      Parameters

      • type: RCIMIWConversationType

        Session type

      • targetId: string

        Session ID

      • channelId: string

        Channel ID, only for super groups, set to null for other session types

      • path: string

        Local path of the GIF message

      Returns Promise<RCIMIWGIFMessage>

      GIF message entity

    • Build custom message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for super groups, pass null for other types

      • policy: RCIMIWCustomMessagePolicy

        Message storage policy

      • messageIdentifier: string

        Unique message identifier

      • fields: Map<string, string>

        Key-value pairs for message content

      Returns Promise<RCIMIWCustomMessage>

      Custom message entity

    • Build location message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups, pass null for other types

      • longitude: number

        Longitude

      • latitude: number

        Latitude

      • poiName: string

        POI info

      • thumbnailPath: string

        Local path to thumbnail, must be valid

      Returns Promise<RCIMIWLocationMessage>

      Location message entity

    • Build native custom message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only for super groups, pass null for other types

      • messageIdentifier: string

        Unique identifier of the message

      • fields: Map<string, Object>

        Key-value pairs of message content

      Returns Promise<RCIMIWNativeCustomMessage>

      Native custom message

    • Build native custom media message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only for super groups, pass null for other types

      • messageIdentifier: string

        Unique message identifier

      • path: string

        Local path of the media file, must be valid

      • fields: Map<string, Object>

        Key-value pairs for message content

      Returns Promise<RCIMIWNativeCustomMediaMessage>

      Native custom media message

    • Send a regular message

      Parameters

      • message: RCIMIWMessage

        The message entity to send

      • Optionalcallback: RCIMIWSendMessageCallback

        Event callback for sending messages. SDK supports callback method from version 5.3.1. Other callback methods are deprecated since version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—specific results require implementing the interface callback. Non-zero indicates failure—no callback will be triggered. Refer to error codes for details

    • Send media message

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success—results are in the callback. Non-zero means failure—no callback triggered. Check error codes for details

    • Cancel sending a media message

      Parameters

      • message: RCIMIWMediaMessage

        Media message entity to cancel

      • Optionalcallback: IRCIMIWCancelSendingMediaMessageCallback

        Event callback for canceling the media message. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback is triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success, specific results require implementing the interface callback. Non-zero means the operation failed, no callback is triggered, and detailed errors refer to the error codes.

    • Download media message

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success, detailed results require interface callback. Non-zero means failure, no callback triggered, refer to error codes for details

    • Cancel media message download

      Parameters

      • message: RCIMIWMediaMessage

        Media message entity to cancel download

      • Optionalcallback: IRCIMIWCancelDownloadingMediaMessageCallback

        Event callback for canceling media message download. SDK supports callback from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback is triggered.

      Returns Promise<number>

      Status code of current operation. 0 means success, with specific results in the callback. Non-zero means failure, and no callback is triggered. Check error codes for details.

    • Fetch a conversation

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only for super groups, pass null for other types

      • Optionalcallback: IRCIMIWGetConversationCallback

        Callback for conversation events. SDK supports callback from version 5.3.1. Other callback methods deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success, results via callback. Non-zero means failure, no callback triggered. Refer to error codes for details

    • Fetch specific conversations

      Parameters

      • conversationTypes: RCIMIWConversationType[]

        Conversation types

      • channelId: string

        Channel ID, only for supergroups, pass null for other types

      • startTime: number

        Timestamp (ms), fetch conversations before this time, pass 0 for latest data

      • count: number

        Number of queries, 0 < count ≤ 50

      • Optionalcallback: IRCIMIWGetConversationsCallback

        Callback for conversation list events. SDK supports callback since 5.3.1. Other callback methods deprecated in 5.4.0, will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success, detailed results via callback. Non-zero means failure, no callback triggered, see error codes for details

    • Get a list of conversations with unread messages by type

      Parameters

      Returns Promise<number>

      Status code of the current operation. 0 means success, results are returned via callback. Non-zero means failure, no callback triggered. See error codes for details

    • Remove a conversation

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for supergroups, pass null for other types

      • Optionalcallback: IRCIMIWRemoveConversationCallback

        Callback for conversation removal. SDK supports callback since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success, non-zero means failure. Detailed errors refer to error codes

    • Remove conversations by type

      Parameters

      • conversationTypes: RCIMIWConversationType[]

        Set of conversation types

      • channelId: string

        Channel ID, only supported for super groups. Pass null for other conversation types.

      • Optionalcallback: IRCIMIWRemoveConversationsCallback

        Callback for conversation removal events. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only callback is triggered.

      Returns Promise<number>

      Status code of the operation. 0 indicates success, specific results require implementing the callback. Non-zero indicates failure, no callback is triggered. Refer to error codes for details.

    • Get unread message count for a session Note: Chat rooms not supported!

      Parameters

      • type: RCIMIWConversationType

        Session type

      • targetId: string

        Session ID

      • channelId: string

        Channel ID, only for super groups. Pass null for other session types.

      • Optionalcallback: IRCIMIWGetUnreadCountCallback

        Callback for unread count events. SDK supports callback since version 5.3.1. Other callback methods deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of current operation. 0 means success, result needs to be handled in callback. Non-zero means failure, no callback triggered. Refer to error codes for details.

    • Get total unread count

      Parameters

      • channelId: string

        Channel ID, only supported for super groups. Pass null for other session types.

      • Optionalcallback: IRCIMIWGetTotalUnreadCountCallback

        Callback for unread count events. SDK supports callback from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for details. Non-zero means the call failed and no callback will be triggered. Refer to error codes for details.

    • Get the count of unread @ messages in a session Note: Not supported in chat rooms

      Parameters

      • type: RCIMIWConversationType

        Session type

      • targetId: string

        Session ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other session types

      • Optionalcallback: IRCIMIWGetUnreadMentionedCountCallback

        Callback for unread @ message count. SDK supports callback since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for results. Non-zero means the call failed, and no callback will be triggered. Refer to error codes for details

    • Get the total count of unread messages from all supergroup chats the user has joined.

      Parameters

      • Optionalcallback: IRCIMIWGetUltraGroupAllUnreadCountCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated starting from version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—implement the callback for results. Non-zero means the call failed—no callback will be triggered. Refer to error codes for details.

    • Get the total count of unread @ mentions across all super group chats the user has joined

      Parameters

      • Optionalcallback: IRCIMIWGetUltraGroupAllUnreadMentionedCountCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only this callback is triggered

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback is triggered. Refer to error codes for details

    • Get unread message count for a specific conversation

      Parameters

      • targetId: string

        Conversation ID

      • Optionalcallback: IRCIMIWGetUltraGroupUnreadCountCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If a callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success, with results in the callback. Non-zero means failure, no callback triggered. Refer to error codes for details.

    • Get the count of @ mentions in a super group chat

      Parameters

      • targetId: string

        Chat ID

      • Optionalcallback: IRCIMIWGetUltraGroupUnreadMentionedCountCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for details. Non-zero means failure—no callback will be triggered. Refer to error codes for details.

    • Load unread count by conversation types Note: Chat rooms aren’t supported!

      Parameters

      • conversationTypes: RCIMIWConversationType[]

        Set of conversation types

      • channelId: string

        Channel ID, only for super groups. Pass null for other conversation types.

      • contain: boolean

        Include unread count from muted messages

      • Optionalcallback: IRCIMIWGetUnreadCountByConversationTypesCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for results. Non-zero means failure—no callback is triggered. Refer to error codes for details.

    • Clear unread message count for a session Note: Not supported for chat rooms!

      Parameters

      • type: RCIMIWConversationType

        Session type

      • targetId: string

        Session ID

      • channelId: string

        Channel ID, only for super groups, pass null for other session types

      • timestamp: number

        Timestamp of the last read message, pass the latest timestamp to clear all

      • Optionalcallback: IRCIMIWClearUnreadCountCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the operation. 0 indicates success, non-zero means failure without triggering the callback. Refer to error codes for details

    • Save session draft info

      Parameters

      • type: RCIMIWConversationType

        Session type

      • targetId: string

        Session ID

      • channelId: string

        Channel ID, only supported for super groups. Pass null for other session types

      • draft: string

        Text content of the draft

      • Optionalcallback: IRCIMIWSaveDraftMessageCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated since version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, and the result needs to be handled in the callback. Non-zero indicates failure, and no callback will be triggered. Refer to error codes for details

    • Fetch draft messages in a conversation

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types

      • Optionalcallback: IRCIMIWGetDraftMessageCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success. For detailed results, implement the callback interface. Non-zero values indicate failure, and no callback will be triggered. Refer to error codes for details

    • Clear draft messages in a specific conversation

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for supergroups, pass null for other conversation types

      • Optionalcallback: IRCIMIWClearDraftMessageCallback

        Event callback. SDK supports callback mode starting from version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, detailed results require implementing the callback. Non-zero indicates failure, no callback will be triggered, refer to error codes for details

    • Get the list of muted conversations

      Parameters

      • conversationTypes: RCIMIWConversationType[]

        Conversation types

      • channelId: string

        Channel ID, only supported for supergroups. Pass null for other conversation types

      • Optionalcallback: IRCIMIWGetBlockedConversationsCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for results. Non-zero means failure—no callback will be triggered. Refer to error codes for details

    • Pin a conversation. If it doesn’t exist, the SDK creates and pins it automatically.

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only for super groups. Pass null for other types.

      • top: boolean

        Pin status

      • Optionalcallback: IRCIMIWChangeConversationTopStatusCallback

        Event callback. Supported since SDK 5.3.1. Other callback methods deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback triggered. See error codes for details.

    • Get the pinned status of a conversation

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for super groups. Pass null for other conversation types.

      • Optionalcallback: IRCIMIWGetConversationTopStatusCallback

        Event callback. SDK supports callback mode starting from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for results. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for details.

    • Sync conversation read status

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for supergroups. Pass null for other conversation types

      • timestamp: number

        Timestamp of the last read message in the conversation

      • Optionalcallback: IRCIMIWSyncConversationReadStatusCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, detailed results need to implement the callback interface. Non-zero indicates failure, and no callback will be triggered. Refer to error codes for details

    • Send a typing status to the conversation. Currently, only one-on-one chats are supported.

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only used for super groups. Pass null for other conversation types.

      • currentType: string

        Current status

      Returns Promise<number>

      Status code of the operation. 0 means success, with results in the callback. Non-zero means failure, no callback triggered. Check error codes for details.

    • Load historical messages

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types

      • sentTime: number

        Current message timestamp

      • order: RCIMIWTimeOrder

        Message retrieval direction. BEFORE: get messages before sentTime (descending), AFTER: get messages after sentTime (ascending)

      • policy: RCIMIWMessageOperationPolicy

        Message loading strategy. LOCAL: load local only, REMOTE: load remote only, LOCAL_REMOTE: load both local and remote

      • count: number

        Number of messages to retrieve, 0 < count ≤ 20

      • Optionalcallback: IRCIMIWGetMessagesCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback is triggered

      Returns Promise<number>

      Status code of the current operation. 0 means success, check the callback for results. Non-zero means failure, no callback is triggered. Refer to error codes for details

    • Get message body by message id (unique value in local database index)

      Parameters

      • messageId: number

        Message id, available in the message object

      • Optionalcallback: IRCIMIWGetMessageCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for results. Non-zero means the call failed, and no callback will be triggered. Refer to error codes for details.

    • Get message entity by global unique ID

      Parameters

      • messageUId: string

        Message UID, available in the message object. Only sent messages have a value.

      • Optionalcallback: IRCIMIWGetMessageCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated since 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for results. Non-zero means failure—no callback will be triggered. Refer to error codes for details.

    • Get the first unread message

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only for super groups—set to null for other types

      • Optionalcallback: IRCIMIWGetFirstUnreadMessageCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated in 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for results. Non-zero means failure—no callback will be triggered. Refer to error codes for details

    • Fetch unread @ messages in a conversation

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types

      • Optionalcallback: IRCIMIWGetUnreadMentionedMessagesCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback will be triggered. Refer to error codes for details

    • Insert a message

      Parameters

      • message: RCIMIWMessage

        The message to insert

      • Optionalcallback: IRCIMIWInsertMessageCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback is triggered.

      Returns Promise<number>

      Status code of the operation. 0 indicates success—check the callback for results. Non-zero means the operation failed, and no callback is triggered. Refer to error codes for details.

    • Insert multiple messages—supergroups not supported

      Parameters

      • messages: RCIMIWMessage[]

        Collection of messages to insert

      • Optionalcallback: IRCIMIWInsertMessagesCallback

        Event callback. SDK supports callback-style events starting from version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—specific results require implementing the callback. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for details.

    • Clear messages

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for supergroups. Pass null for other conversation types

      • timestamp: number

        Clear messages up to this timestamp. 0 ≤ timestamp ≤ sentTime of the last message in the current conversation. 0 clears all messages, other values clear messages ≤ recordTime

      • policy: RCIMIWMessageOperationPolicy

        Clear policy

      • Optionalcallback: IRCIMIWClearMessagesCallback

        Event callback. SDK supports callback method from version 5.3.1. Other callback methods deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only callback is triggered

      Returns Promise<number>

      Status code of current operation. 0 means success, non-0 means failure. For detailed errors, refer to error codes

    • Delete local messages

      Parameters

      • messages: RCIMIWMessage[]

        Message collection

      • Optionalcallback: IRCIMIWDeleteLocalMessagesCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated since version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for details. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for more info.

    • Delete messages

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types.

      • messages: RCIMIWMessage[]

        Message collection

      • Optionalcallback: IRCIMIWDeleteMessagesCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—results are returned via the callback. Non-zero indicates failure—no callback is triggered. Refer to error codes for details.

    • Recall a message

      Parameters

      • message: RCIMIWMessage

        Message to be recalled

      • Optionalcallback: IRCIMIWRecallMessageCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, and the result needs to be handled in the callback. Non-zero indicates failure, and no callback will be triggered. Refer to the error codes for details.

    • Send read receipt for messages in a conversation

      Parameters

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types.

      • timestamp: number

        Timestamp of the last read message in the conversation

      • Optionalcallback: IRCIMIWSendPrivateReadReceiptMessageCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success. Specific results require implementing the callback. Non-zero indicates failure, and no callback will be triggered. Refer to error codes for details.

    • Request group chat message read receipt

      Parameters

      • message: RCIMIWMessage

        Message to request read receipt for

      • Optionalcallback: IRCIMIWSendGroupReadReceiptRequestCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered.

      Returns Promise<number>

      Status code of current operation. 0 means success—check callback for details. Non-zero means failure—no callback triggered. Refer to error codes for details.

    • Send group read receipt

      Parameters

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types.

      • messages: RCIMIWMessage[]

        List of messages in the conversation to send read receipts for

      • Optionalcallback: IRCIMIWSendGroupReadReceiptResponseCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, with specific results in the callback. Non-zero indicates failure, no callback will be triggered. Refer to error codes for details

    • Update message expansion info Each message can carry up to 300 key-value pairs, with a max of 20 pairs per update

      Parameters

      • messageUId: string

        Message’s unique ID, available in the message object—only sent messages have this value

      • expansion: Map<string, string>

        Key-value pairs to update, stored in a HashMap. Keys support letters, numbers, and special characters (+ = - _)—no Chinese characters. Values can include spaces

      • Optionalcallback: IRCIMIWUpdateMessageExpansionCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback will be triggered. See error codes for details

    • Remove specific key-value pairs from message extensions

      Parameters

      • messageUId: string

        Message’s messageUid, available in the message object. Only successfully sent messages have a value

      • keys: string[]

        List of keys to remove from message extensions, type is ArrayList

      • Optionalcallback: IRCIMIWRemoveMessageExpansionForKeysCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback is triggered

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for results. Non-zero means the operation failed, and no callback is triggered. Refer to error codes for details

    • Set message sending status

      Parameters

      • messageId: number

        Message ID, available in the message object

      • sentStatus: RCIMIWSentStatus

        Status to modify

      • Optionalcallback: IRCIMIWChangeMessageSentStatusCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback is triggered

      Returns Promise<number>

      Status code of the operation. 0 means success, specific results require interface callback. Non-zero means failure, no callback triggered, see error codes for details

    • Set message receive status

      Parameters

      • messageId: number

        Message ID, available from the message object

      • receivedStatus: RCIMIWReceivedStatus

        Status to modify

      • Optionalcallback: IRCIMIWChangeMessageReceivedStatusCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback will be triggered. Refer to error codes for details

    • Join a chat room

      Parameters

      • targetId: string

        Chat room session ID

      • messageCount: number

        Number of messages to fetch upon entry, -1 fetches none, 0 fetches 10, max 50

      • autoCreate: boolean

        Create chat room if it doesn’t exist, TRUE creates and joins, FALSE joins directly if exists

      • Optionalcallback: IRCIMIWJoinChatRoomCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods deprecated in 5.4.0, will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of current operation, 0 means success, non-0 means failure, no callback triggered, see error codes for details

    • Leave a chat room

      Parameters

      • targetId: string

        Chat room session ID

      • Optionalcallback: IRCIMIWLeaveChatRoomCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback will be triggered. Refer to error codes for details

    • Fetch chat room message history. Note: Enable cloud storage for chat room messages first.

      Parameters

      • targetId: string

        Chat room session ID

      • timestamp: number

        Start message timestamp

      • order: RCIMIWTimeOrder

        Fetch order: 0 for reverse, 1 for forward

      • count: number

        Number of messages to fetch, 0 < count ≤ 50

      • Optionalcallback: IRCIMIWGetChatRoomMessagesCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback is triggered.

      Returns Promise<number>

      Status code of current operation. 0 means success—check callback for details. Non-zero means failure—no callback is triggered. Refer to error codes for details.

    • Set custom chat room properties

      Parameters

      • targetId: string

        Chat room session ID

      • key: string

        Property name, supports uppercase, lowercase letters, numbers, and special characters + = - _, max length 128 characters

      • value: string

        Property value, max length 4096 characters

      • deleteWhenLeft: boolean

        Automatically delete key-value pair when user disconnects or leaves

      • overwrite: boolean

        Overwrite existing key if present

      • Optionalcallback: IRCIMIWAddChatRoomEntryCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods deprecated in 5.4.0, planned for removal in 6.x. If callback is provided, only callback is triggered

      Returns Promise<number>

      Status code of current operation. 0 indicates success, non-zero indicates failure. Detailed errors refer to error codes

    • Set chat room custom properties in bulk

      Parameters

      • targetId: string

        Chat room session ID

      • entries: Map<string, string>

        Chat room properties

      • deleteWhenLeft: boolean

        Whether to automatically delete the key-value pair when user disconnects or leaves

      • overwrite: boolean

        Whether to force overwrite

      • Optionalcallback: IRCIMIWAddChatRoomEntriesCallback

        Event callback. SDK supports callback method from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered

      Returns Promise<number>

      Status code of current operation. 0 indicates success—check callback for details. Non-zero indicates failure—no callback will be triggered. Refer to error codes for details

    • Get a single chat room property

      Parameters

      • targetId: string

        Chat room session ID

      • key: string

        Chat room property key

      • Optionalcallback: IRCIMIWGetChatRoomEntryCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for results. Non-zero means the operation failed—no callback will be triggered. Refer to error codes for details.

    • Get all chatroom properties

      Parameters

      • targetId: string

        Chatroom session ID

      • Optionalcallback: IRCIMIWGetChatRoomAllEntriesCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered

      Returns Promise<number>

      Status code of current operation. 0 means success—specific results need to implement the callback. Non-zero means the operation failed—no callback will be triggered. Refer to error codes for details

    • Remove custom chat room attributes.

      Parameters

      • targetId: string

        Chat room session ID

      • key: string

        Chat room attribute key

      • force: boolean

        Force deletion

      • Optionalcallback: IRCIMIWRemoveChatRoomEntryCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated starting from version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 indicates success, and results are returned via callback. Non-zero indicates failure, and no callback is triggered. Refer to error codes for details.

    • Delete chat room custom attributes in bulk

      Parameters

      • targetId: string

        Chat room session ID

      • keys: string[]

        Chat room attributes

      • force: boolean

        Force override

      • Optionalcallback: IRCIMIWRemoveChatRoomEntriesCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated starting from version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback is triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for results. Non-zero means the operation failed, and no callback is triggered. Refer to error codes for details.

    • Block a user Once blocked, they’ll see “Message failed—you’re blocked” when trying to message you. You can still message them.

      Parameters

      • userId: string

        User ID

      • Optionalcallback: IRCIMIWAddToBlacklistCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated as of 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for results. Non-zero means failure—no callback will be triggered. See error codes for details.

    • Remove a user from the blacklist

      Parameters

      • userId: string

        User ID

      • Optionalcallback: IRCIMIWRemoveFromBlacklistCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for details. Non-zero means the operation failed—no callback will be triggered. Refer to error codes for details.

    • Check if a user is on the blacklist

      Parameters

      • userId: string

        User ID

      • Optionalcallback: IRCIMIWGetBlacklistStatusCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—results are returned via the callback. Non-zero values indicate failure, and no callback will be triggered. Refer to error codes for details.

    • Get the current user’s blacklist

      Parameters

      • Optionalcallback: IRCIMIWGetBlacklistCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for results. Non-zero means failure—no callback will be triggered. Refer to error codes for details

    • Search messages in a specific conversation by keyword.

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in super groups. Pass null for other conversation types.

      • keyword: string

        Search keyword

      • startTime: number

        Search messages before beginTime. Pass 0 to start from the latest message and search backward.

      • count: number

        Number of messages to query, 0 < count ≤ 50.

      • Optionalcallback: IRCIMIWSearchMessagesCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated since 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, with detailed results in the callback. Non-zero means the call failed, no callback will be triggered. Refer to error codes for details.

    • Search messages in a specific conversation within a time range by keyword.

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for super groups, pass null for other conversation types

      • keyword: string

        Search keyword

      • startTime: number

        Start time

      • endTime: number

        End time

      • offset: number

        Offset

      • count: number

        Number of search results to return, 0 < count ≤ 50

      • Optionalcallback: IRCIMIWSearchMessagesByTimeRangeCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, detailed results require implementing the callback, non-0 indicates failure and won't trigger the callback, refer to error codes for details

    • Search messages in a specific conversation by user ID.

      Parameters

      • userId: string

        User ID

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for super groups. Pass null for other conversation types.

      • startTime: number

        Start time for query. Pass 0 to search from the latest message, searching backward from this time.

      • count: number

        Number of search results to return. 0 < count ≤ 50.

      • Optionalcallback: IRCIMIWSearchMessagesByUserIdCallback

        Event callback. SDK supports callback method from version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for results. Non-zero indicates failure—no callback will be triggered. Refer to error codes for details.

    • Search conversations by keyword.

      Parameters

      • conversationTypes: RCIMIWConversationType[]

        Conversation type collection

      • channelId: string

        Channel ID, only supported for super groups, pass null for other conversation types

      • messageTypes: RCIMIWMessageType[]

        Message types to search

      • keyword: string

        Keyword to search

      • Optionalcallback: IRCIMIWSearchConversationsCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered

      Returns Promise<number>

      Status code of current operation. 0 means success, results need to be handled via callback. Non-zero means failure, no callback will be triggered, refer to error codes for details

    • Mute notifications for a specific time period

      Parameters

      • startTime: string

        Start time in HH:MM:SS format

      • spanMinutes: number

        Duration in minutes, 0 < spanMinutes < 1440 (e.g., 60 means 1 hour, 1439 means all day)

      • level: RCIMIWPushNotificationQuietHoursLevel

        Notification level

      • Optionalcallback: IRCIMIWChangeNotificationQuietHoursCallback

        Event callback. Supported since SDK 5.3.1. Other callback methods deprecated in 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of the operation. 0 means success, non-zero means failure. Detailed errors refer to error codes

    • Remove global quiet hours for message notifications

      Parameters

      • Optionalcallback: IRCIMIWRemoveNotificationQuietHoursCallback

        Event callback. SDK supports callback method from version 5.3.1. Other callback methods are deprecated starting from version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for details. Non-zero means the operation failed—no callback will be triggered. Refer to error codes for details.

    • Get the set quiet hours for message notifications

      Parameters

      • Optionalcallback: IRCIMIWGetNotificationQuietHoursCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for details. Non-zero means failure—no callback will be triggered. Refer to error codes for details.

    • Set message notification level for a conversation Note: For supergroups, leaving channelId empty sets the do-not-disturb level for messages not in any channel, without affecting all channels in the supergroup

      Parameters

      • type: RCIMIWConversationType

        Conversation type. Note the following restrictions:

        • Supergroup type: If supergroup service was enabled before 2022.09.01, setting a do-not-disturb level for all messages in a supergroup (i.e., messages in all channels and messages not in any channel) is not supported by default. This API only sets the do-not-disturb level for messages not in any channel within the specified supergroup (targetId). Submit a ticket to modify this behavior.
        • Chatroom type: Not supported, as chatroom messages don’t support push notifications by default.

      • targetId: string

        Conversation ID

      • channelId: string

        Supergroup channel ID. Pass null for other types.

        • If a channel ID is provided, the do-not-disturb level is set for that specific channel. If no channel ID is specified, it applies to all supergroup messages.
        • Note: For customers who enabled supergroup service before 2022.09.01, if no channel ID is specified, pass an empty string "" to set the do-not-disturb level only for messages not in any channel within the specified supergroup (targetId). Submit a ticket to modify this behavior.

      • level: RCIMIWPushNotificationLevel

        Message notification level

      • Optionalcallback: IRCIMIWChangeConversationNotificationLevelCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated as of 5.4.0 and will be removed in 6.x. If callback is provided, only the callback is triggered.

      Returns Promise<number>

      Status code of the operation. 0 indicates success. Specific results require implementing the callback. Non-zero indicates failure, and no callback is triggered. Refer to error codes for details.

    • Get conversation notification status

      Parameters

      • type: RCIMIWConversationType

        Conversation type. Note the following limitations:

        • Supergroup type: If you enabled supergroup before 2022.09.01, setting a Do Not Disturb level for all messages in a single supergroup is not supported by default (“all messages” refers to messages in all channels and messages not in any channel). This API only sets the Do Not Disturb level for messages not in any channel in the specified supergroup (targetId). Submit a ticket for changes.
        • Chatroom type: Not supported, as chatroom messages don’t support push notifications by default.

      • targetId: string

        Conversation ID

      • channelId: string

        Supergroup channel ID. Pass null for other types.

        • If a channel ID is passed, the Do Not Disturb level is set for that specific channel. If no channel ID is specified, it applies to all supergroup messages.
        • Note: For customers who enabled supergroup before 2022.09.01, if no channel ID is specified, pass an empty string "" to set the Do Not Disturb level only for messages not in any channel in the specified supergroup (targetId). Submit a ticket for changes.

      • Optionalcallback: IRCIMIWGetConversationNotificationLevelCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated as of 5.4.0 and will be removed in 6.x. If a callback is passed, only the callback is triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success, and specific results require implementing the callback. Non-zero means the operation failed, and no callback is triggered. Refer to error codes for details.

    • Set default message status for super groups Typically set by admins, applies to all members and channels in the super group. Has lower priority. If a member sets their own DND level, it overrides the default.

      Parameters

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback triggered. Refer to error codes for details.

    • Get the default message status for a super group

      Parameters

      • targetId: string

        Conversation ID

      • Optionalcallback: IRCIMIWGetUltraGroupDefaultNotificationLevelCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—specific results require implementing the callback. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for details.

    • Set default message status for supergroup channel

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success, detailed results need to implement the callback. Non-zero means failure, no callback triggered, refer to error codes for details

    • Get the default message status for an ultra group channel

      Parameters

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for ultra groups

      • Optionalcallback: IRCIMIWGetUltraGroupChannelDefaultNotificationLevelCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for details. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for details

    • Set whether to show remote push content details. This feature requires enabling user settings from the server.

      Parameters

      • showContent: boolean

        Whether to show remote push content

      • Optionalcallback: IRCIMIWChangePushContentShowStatusCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in version 6.x. If the callback parameter is passed, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success. For specific results, implement the interface callback. Non-zero indicates failure, and no callback will be triggered. Refer to error codes for details.

    • Set push language

      Parameters

      • language: string

        Push language, currently supports en_us, zh_cn, and ar_sa

      • Optionalcallback: IRCIMIWChangePushLanguageCallback

        Event callback. SDK supports callback method from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, detailed results require implementing the interface callback. Non-zero indicates failure, no callback will be triggered, refer to error codes for details.

    • Set whether to receive remote push notifications Prerequisite: Mobile device is offline, Web and MAC/PC terminals are online This feature requires enabling user settings from the server

      Parameters

      • receive: boolean

        Whether to receive

      • Optionalcallback: IRCIMIWChangePushReceiveStatusCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated starting from version 5.4.0 and will be removed in version 6.x. If a callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, and specific results need to be implemented in the interface callback. Non-zero indicates failure, and no interface callback will be triggered. Refer to error codes for details

    • Send a message to specified group members

      Parameters

      • message: RCIMIWMessage

        Message to send

      • userIds: string[]

        Group member IDs

      • Optionalcallback: RCIMIWSendGroupMessageToDesignatedUsersCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated since 5.4.0 and will be removed in 6.x. If callback is provided, only callback is triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback is triggered. Refer to error codes for details.

    • Get the total number of messages in a specified conversation.

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported for super groups. Pass null for other conversation types.

      • Optionalcallback: IRCIMIWGetMessageCountCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback method will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, and the specific result needs to be handled in the callback. Non-zero indicates failure, and no callback will be triggered. Refer to the error code for details.

    • Get the list of pinned conversations by type

      Parameters

      • conversationTypes: RCIMIWConversationType[]

        Set of conversation types

      • channelId: string

        Channel ID, only supported for supergroups. Pass null for other conversation types.

      • Optionalcallback: IRCIMIWGetTopConversationsCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in 6.x. If callback is provided, only callback will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success, and results are returned via callback. Non-zero means failure, and no callback will be triggered. Refer to error codes for details.

    • Report read time for supergroups

      Parameters

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, supported for supergroups only

      • timestamp: number

        Read time

      • Optionalcallback: IRCIMIWSyncUltraGroupReadStatusCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of current operation. 0 means success—check callback for details. Non-zero means failure—no callback triggered. Refer to error codes for details

    • Get conversation list for all channels under a specific session—super group only

      Parameters

      • type: RCIMIWConversationType

        Conversation type

      • targetId: string

        Conversation ID

      • Optionalcallback: IRCIMIWGetConversationsForAllChannelCallback

        Event callback. SDK supports callback method from version 5.3.1. Other callback methods are deprecated starting from version 5.4.0 and will be removed in 6.x. If callback is provided, only callback is triggered.

      Returns Promise<number>

      Status code of current operation. 0 indicates success—specific results require implementing the callback. Non-zero means the operation failed—no callback is triggered. Refer to error codes for details.

    • Modify ultra group message

      Parameters

      • messageUId: string

        Unique message ID, available in the message object. Only successfully sent messages have this value

      • message: RCIMIWMessage

        Message to modify

      • Optionalcallback: IRCIMIWModifyUltraGroupMessageCallback

        Event callback. SDK supports callback method from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered

      Returns Promise<number>

      Status code of current operation. 0 means success—check the callback for details. Non-zero means failure—no callback will be triggered. Refer to error codes for details

    • Recall a supergroup message

      Parameters

      • message: RCIMIWMessage

        Message to recall

      • deleteRemote: boolean

        Whether to delete the remote message

      • Optionalcallback: IRCIMIWRecallUltraGroupMessageCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 means success, but you’ll need to implement the callback for details. Non-zero means the operation failed, and no callback will be triggered. Check error codes for details.

    • Delete messages in a supergroup before a specified time

      Parameters

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in supergroups

      • timestamp: number

        Timestamp

      • policy: RCIMIWMessageOperationPolicy

        Clear policy

      • Optionalcallback: IRCIMIWClearUltraGroupMessagesCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated in version 5.4.0 and will be removed in version 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, detailed results require implementing the callback interface. Non-zero indicates failure, no callback will be triggered, refer to error codes for details

    • Send ultra group typing status

      Parameters

      • targetId: string

        Conversation ID

      • channelId: string

        Channel ID, only supported in ultra groups

      • typingStatus: TEXT

        Typing status

      • Optionalcallback: IRCIMIWSendUltraGroupTypingStatusCallback

        Event callback. SDK supports callback mode from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If callback is provided, only the callback will be triggered

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, non-zero indicates failure. Detailed errors refer to the error codes

    • Clear messages before a specific timestamp in all channels of a supergroup

      Parameters

      • targetId: string

        Conversation ID

      • timestamp: number

        Timestamp

      • Optionalcallback: IRCIMIWClearUltraGroupMessagesForAllChannelCallback

        Event callback. SDK supports callback from version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If a callback is provided, only the callback will be triggered.

      Returns Promise<number>

      Status code of the operation. 0 indicates success, detailed results require implementing the callback. Non-zero indicates failure, no callback will be triggered, refer to error codes for details.

    • Fetch batch messages from the server

      Parameters

      • messages: RCIMIWMessage[]

        Retrieved message collection

      • Optionalcallback: IRCIMIWGetBatchRemoteUltraGroupMessagesCallback

        Event callback. SDK supports callback mode since version 5.3.1. Other callback methods are deprecated from version 5.4.0 and will be removed in 6.x. If a callback is provided, only it will be triggered.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for results. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for details.

    • Update ultra group message expansion info

      Parameters

      • messageUId: string

        Message’s unique identifier, available in the message object. Only sent messages have this value.

      • expansion: Map<string, string>

        Key-value pairs for updated message expansion info, type is HashMap. Key supports uppercase/lowercase letters, numbers, and special symbols + = - _. No Chinese characters. Value can include spaces.

      • Optionalcallback: IRCIMIWUpdateUltraGroupMessageExpansionCallback

        Event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated as of version 5.4.0 and will be removed in version 6.x. If callback is provided, only callback is triggered.

      Returns Promise<number>

      Status code of the current operation. 0 means success—check the callback for results. Non-zero means the call failed, no callback is triggered. See error codes for details.

    • Remove specific key-value pairs from supergroup message expansion

      Parameters

      • messageUId: string

        messageUid of the message, available in the message object, and only successful messages have a value

      • keys: string[]

        list of keys to remove from message expansion, type is ArrayList

      • Optionalcallback: IRCIMIWRemoveUltraGroupMessageExpansionForKeysCallback

        event callback. SDK supports callback since version 5.3.1. Other callback methods are deprecated since version 5.4.0 and will be removed in version 6.x. If callback is provided, only callback will be triggered.

      Returns Promise<number>

      status code of current operation. 0 means success, specific result requires implementing the callback, non-0 means failure and no callback will be triggered, refer to error codes for details

    • Modify log level

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success, results require callback implementation. Non-zero means failure, no callback triggered. Refer to error codes for details

    • Get the time difference between local and server time. After a message is sent, the SDK syncs with the server, and the time stored in the database is the server time. Use System.currentTimeMillis() - getDeltaTime() to get the current server time.

      Returns Promise<number>

      Time difference between local and server time

    • Create tag info

      Parameters

      • tagId: string

        Unique identifier of the tag, string type, max length 10 chars.

      • tagName: string

        Max length 15 chars, tag names can be duplicated.

      • Optionalcallback: IRCIMIWCreateTagCallback

        Event callback.

      Returns Promise<number>

      Status code of current operation. 0 means success, check callback for details. Non-zero means failure, no callback triggered, refer to error codes for details.

    • Remove tag

      Parameters

      • tagId: string

        Unique identifier of the tag, string type, max length 10 characters

      • Optionalcallback: IRCIMIWRemoveTagCallback

        Event callback

      Returns Promise<number>

      Status code of current operation. 0 means success, check callback for details. Non-zero means failure, no callback triggered. Refer to error codes for details

    • Update tag info

      Parameters

      • tagId: string

        Unique tag ID, string type, max 10 chars

      • newName: string

        New tag name, max 15 chars, duplicates allowed

      • Optionalcallback: IRCIMIWUpdateTagNameByIdCallback

        Event callback

      Returns Promise<number>

      Status code: 0 for success, trigger callback; non-zero for failure, no callback, see error codes

    • Get the tags created by the current user

      Parameters

      Returns Promise<number>

      Status code of the current operation. 0 means success, with details in the callback. Non-zero means failure, no callback triggered. Refer to error codes for details

    • Add a session to a specific tag

      Parameters

      Returns Promise<number>

      Status code of the operation. 0 means success—check the callback for details. Non-zero means failure—no callback triggered. Refer to error codes for details

    • Remove a session from the tag

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success—check callback for details. Non-zero means failure—no callback triggered. See error codes for details

    • Remove one or more tags from a specific session

      Parameters

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, with results returned via the callback. Non-zero indicates failure, no callback triggered, and detailed errors in the error codes

    • Fetch paginated local conversation list under a specific tag, using the timestamp of the last message in the conversation as the boundary

      Parameters

      • tagId: string

        Unique identifier of the tag, string type, max length 10 characters

      • timestamp: number

        Timestamp of the conversation. Fetches conversations before this timestamp. Pass 0 for the first call, then use the operationTime property of the returned RCConversation object as the startTime for the next query

      • count: number

        Number of conversations to fetch. If the actual number of conversations retrieved is less than count, it means all data has been fetched

      • Optionalcallback: IRCIMIWGetConversationsCallback

        Event callback

      Returns Promise<number>

      Status code of the current operation. 0 indicates success—check the callback for results. Non-zero means the operation failed, and no callback will be triggered. Refer to error codes for details

    • Get unread message count for all sessions with a specific tag

      Parameters

      • tagId: string

        Unique tag identifier, string type, max length 10 chars

      • contain: boolean

        Include do-not-disturb sessions

      • Optionalcallback: IRCIMIWGetUnreadCountCallback

        Event callback

      Returns Promise<number>

      Status code of current operation. 0 means success, check callback for results. Non-zero means failure, no callback triggered. Refer to error codes for details

    • Pin a specific chat in all sessions with a given tag. For example, pin a private chat with "Tom" in all sessions tagged "Training Class".

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success—check callback for results. Non-zero means failure—no callback triggered. Refer to error codes for details

    • Check if a session is pinned among all sessions with the same tag. Returns the pinned status on success.

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 indicates success, non-zero indicates failure. Detailed errors refer to error codes

    • Clear unread message count for all sessions with a specific tag

      Parameters

      Returns Promise<number>

      Status code of current operation. 0 means success, specific results require callback implementation. Non-zero means failure, no callback triggered. Refer to error codes for details

    • Delete all sessions under a specific tag and unbind them from the tag. Once deleted, sessions no longer carry the specified tag. New messages in these sessions will create new sessions.

      Parameters

      • tagId: string

        Unique identifier of the tag, string type, up to 10 characters.

      • deleteMessage: boolean

        Whether to delete messages

      • Optionalcallback: IRCIMIWClearConversationsByTagCallback

        Event callback.

      Returns Promise<number>

      Status code of the current operation. 0 indicates success, specific results require implementing the callback. Non-zero indicates failure, no callback will be triggered, refer to error codes for details.

    • Listen for incoming messages

      Parameters

      • Optionallistener: (
            message: RCIMIWMessage,
            left: number,
            offline: boolean,
            hasPackage: boolean,
        ) => void

      Returns void

    • Network status change

      Parameters

      Returns void

    • Sync session pin status across devices

      Parameters

      • Optionallistener: (
            type: RCIMIWConversationType,
            targetId: string,
            channelId: string,
            top: boolean,
        ) => void

      Returns void

    • Multi-device sync for session do-not-disturb status

      Parameters

      Returns void

    • Message recall listener

      Parameters

      Returns void

    • Callback for message receipt in single chat

      Parameters

      • Optionallistener: (targetId: string, channelId: string, timestamp: number) => void

      Returns void

    • Callback for message expansion changes

      Parameters

      • Optionallistener: (expansion: Map<string, string>, message: RCIMIWMessage) => void

      Returns void

    • Callback for deleted message extensions

      Parameters

      • Optionallistener: (message: RCIMIWMessage, keys: string[]) => void

      Returns void

    • Monitor chat room user join and exit events

      Parameters

      Returns void

    • Chat input status changes. For 1:1 chats, the listener triggers once when the other party is typing, and again when they stop. In the latter case, the typing user list in the callback is empty.

      Parameters

      Returns void

    • Listen for unread message sync. Triggered when another device clears unread counts for a session

      Parameters

      Returns void

    • Callback for chatroom KV sync completion

      Parameters

      • Optionallistener: (roomId: string) => void

      Returns void

    • Callback for chat room KV changes

      Parameters

      Returns void

    • Supergroup message KV updated

      Parameters

      Returns void

    • Supergroup messages updated

      Parameters

      Returns void

    • Supergroup messages recalled

      Parameters

      Returns void

    • Listen for supergroup read receipts

      Parameters

      • Optionallistener: (targetId: string, channelId: string, timestamp: number) => void

      Returns void

    • Callback for user input status changes Triggered when the client detects changes in user input status, notifying the session and current RCUltraGroupTypingStatusInfo list

      Parameters

      Returns void

    • Callback for intercepted messages containing sensitive words

      Parameters

      Returns void

    • Listen for chat room status changes

      Parameters

      Returns void

    • Listener for group chat read receipt requests

      Parameters

      • Optionallistener: (targetId: string, messageUId: string) => void

      Returns void

    • Listener for group chat read receipt response

      Parameters

      • Optionallistener: (
            targetId: string,
            messageUId: string,
            respondUserIds: Map<string, number>,
        ) => void

      Returns void

    • Callback when super group list sync completes

      Parameters

      • Optionallistener: () => void

      Returns void

    • Callback for joining a chat room

      Parameters

      • Optionallistener: (targetId: string) => void

      Returns void