Class ChannelClient
-
- All Implemented Interfaces:
public abstract class ChannelClient
-
-
Constructor Summary
Constructors Constructor Description ChannelClient()
-
Method Summary
Modifier and Type Method Description static ChannelClientgetInstance()abstract voidgetConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId)获取当前用户本地会话列表,该方法返回的是以下类型的会话列表:私聊,群组,讨论组,系统会话。 此方法会从本地数据库中,读取会话列表。返回的会话列表排序规则为:按照时间从前往后排列,如果有置顶的会话,则置顶的会话会排列在前面。 如果您需要获取其它类型的会话列表,可以使用getConversationList} 。 需要在连接数据库打开回调 OnDatabaseOpened后调用,IRongCoreCallback.ConnectCallback 。abstract voidgetConversationList(String channelId, IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)根据会话类型,获取当前用户的本地会话列表。 abstract voidgetTopConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)根据会话类型,获取置顶会话列表 abstract voidgetConversationListByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, long timeStamp, int count, String channelId, Array<ConversationType> conversationTypes)分页获取会话列表。 abstract voidgetBlockedConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)获取免打扰的会话列表。 abstract voidgetUnreadConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)根据会话类型,获取当前用户未读的本地会话列表。 abstract voidgetConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Conversation> callback)获取单个会话信息。 abstract voidupdateConversationInfo(ConversationType conversationType, String targetId, String channelId, String title, String portrait, IRongCoreCallback.ResultCallback callback)更新会话信息。 abstract voidremoveConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)从会话列表中移除某一会话。 此方法不删除会话内的消息。如果此会话中有新的消息,该会话将重新在会话列表中显示,并显示最近的历史消息。 abstract voidremoveConversations(List<ConversationIdentifier> conversationIdentifiers, IRongCoreCallback.ResultCallback<Boolean> callback)批量从会话列表中移除某一会话。 此方法不删除会话内的消息。如果此会话中有新的消息,该会话将重新在会话列表中显示,并显示最近的历史消息。 支持的会话类型:单聊, 群聊, 系统消息 abstract voidsetConversationToTop(ConversationType conversationType, String id, String channelId, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)设置会话的置顶状态。 若会话不存在,调用此方法 SDK 自动创建会话并置顶。 abstract voidsetConversationsToTop(List<ConversationIdentifier> conversationIdentifiers, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)异步批量设置会话的置顶状态 abstract voidgetTotalUnreadCount(String channelId, IRongCoreCallback.ResultCallback<Integer> callback)获取所有会话的总未读消息数。 注意:不包含聊天室,聊天室消息不计数。 abstract voidgetTotalUnreadCount(String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)abstract voidgetUnreadCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)获取指定会话的未读消息数。 注意:不包含聊天室,聊天室消息不计数。 abstract voidgetUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback, String channelId, Array<ConversationType> conversationTypes)获取指定会话类型的总未读消息数。 注意:不包含聊天室,聊天室消息不计数。 abstract voidgetUnreadCount(Array<ConversationType> conversationTypes, String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)获取指定会话类型的总未读消息数。 注意:不包含聊天室,聊天室消息不计数。 abstract voidgetMessageCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)获取指定会话的消息总数。 abstract voidgetLatestMessages(ConversationType conversationType, String targetId, String channelId, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)获取指定会话的最新消息。 abstract voidgetHistoryMessages(ConversationType conversationType, String targetId, String channelId, String objectName, int oldestMessageId, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)获取会话中符合条件的消息列表。 返回的消息中不包含 oldestMessageId 对应那条消息,如果会话中的消息数量小于参数 count 的值,会将该会话中的所有消息返回。 如:oldestMessageId 为 10,count 为 2,会返回 messageId 为 9 和 8 的 Message 对象列表。 注意:不支持拉取聊天室 CHATROOM 历史消息 该方法仅获取本地数据库中的消息。 注意:since 5.4. abstract voidgetHistoryMessages(ConversationType conversationType, String targetId, String channelId, String objectName, int baseMessageId, int count, RongCommonDefine.GetMessageDirection direction, IRongCoreCallback.ResultCallback<List<Message>> callback)获取会话中符合条件的消息列表。 如:获取 messageId 为 22 的之前的 10条 图片消息,则相应参数为 getHistoryMessages(conversationType, targetId, "RC:ImgMsg", 22, 10, true, resultCallback)。 注意:不支持拉取聊天室 CHATROOM 历史消息 该方法仅获取本地数据库中的消息。 注意:since 5.4. abstract voidgetHistoryMessages(ConversationType conversationType, String targetId, String channelId, List<String> objectNames, long timestamp, int count, RongCommonDefine.GetMessageDirection direction, IRongCoreCallback.ResultCallback<List<Message>> callback)获取会话中符合条件的消息列表。 如: 要获取 messageId 为 22 的之前的 10 条图片消息,和文字消息 objectNames 为字符串 List
则相应参数为 getHistoryMessages(conversationType, targetId, objectNames, 22, 10, true, resultCallback)。 该方法仅获取本地数据库中的消息。 注意:since 5.4.objectNames.add("RC:ImgMsg"); objectNames.add("RC:TxtMsg");abstract voidgetRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long dateTime, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)从服务器端获取指定时间之前的历史消息。(不支持超级群) 区别于 getHistoryMessages,该接口是从融云服务器中拉取。从服务端拉取消息后,客户端会做排重,返回排重后的数据。通常用于更换新设备后,拉取历史消息。 使用的时候,建议优先通过 getHistoryMessages 从本地数据库拉取历史消息, 当本地数据库没有历史消息后,再通过此接口获取服务器历史消息,时间戳传入本地数据库里最早的消息时间戳。注意: 1. abstract voidgetRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, RemoteHistoryMsgOption remoteHistoryMsgOption, IRongCoreCallback.ResultCallback<List<Message>> callback)获取指定会话远端历史消息。(不支持超级群) 此功能需要在融云开发者后台开启历史消息云存储功能。注意:不支持聊天室! abstract voidcleanRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, IRongCoreCallback.OperationCallback callback)清除服务器上存储的历史消息。 根据会话类型和目标会话 id 清除某一会话指定时间戳之前的服务端历史消息, 清除成功后只能从服务端获取到该时间戳之后的历史消息。 注意:必须先开通历史消息云存储功能! abstract voidcleanHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, boolean cleanRemote, IRongCoreCallback.OperationCallback callback)删除指定时间戳之前的消息,可选择是否同时删除服务器端消息 此方法可从服务器端清除历史消息,但是必须先开通历史消息云存储功能。 根据会话类型和会话 id 清除某一会话指定时间戳之前的本地数据库消息(服务端历史消息), 清除成功后只能从本地数据库(服务端)获取到该时间戳之后的历史消息。 abstract voidgetHistoryMessages(ConversationType conversationType, String targetId, int oldestMessageId, int count, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)获取会话中,从指定消息之前、指定数量的、指定消息类型的最新消息实体。 注意:不支持聊天室! 该方法仅获取本地数据库中的消息。 注意:since 5.4. abstract voiddeleteMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)删除某个会话中的所有消息。 此接口删除指定会话中数据库的所有消息,同时会清理数据库空间,减少占用空间。 abstract voiddeleteRemoteMessages(ConversationType conversationType, String targetId, String channelId, Array<Message> messages, IRongCoreCallback.OperationCallback callback)批量删除某个会话中的指定远端消息(同时删除对应的本地消息)。 一次批量操作仅支持删除属于同一个会话的消息,请确保消息列表中的所有消息来自同一会话,一次最多删除 100 条消息。 注意:不支持聊天室、超级群! abstract voidclearMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)删除某个会话中的所有消息。 注意:不支持聊天室! abstract voidclearMessages(List<ClearMessageOption> clearMessageOptions, IRongCoreCallback.ResultCallback<Boolean> callback)异步批量删除指定会话早于(含)发送时间的所有本地数据库消息。 此方法删除数据库中会话早于(含)发送时间的消息记录, 时间戳传 0 清除所有消息 支持的会话类型:单聊, 群聊, 聊天室, 系统消息 abstract voidclearRemoteMessages(List<ClearMessageOption> clearMessageOptions, boolean isDeleteLocal, IRongCoreCallback.OperationCallback callback)异步批量删除服务端指定会话早于(含)发送时间的所有远端消息(可以删除对应的本地消息) 时间戳传 0 清除所有消息 支持的会话类型:单聊, 群聊, 聊天室, 系统消息 abstract voidclearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)清除某个会话中的未读消息数。 注意:不支持聊天室,不支持超级群 abstract voidgetTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<String> callback)获取会话中的草稿信息。 abstract voidsaveTextMessageDraft(ConversationType conversationType, String targetId, String channelId, String content, IRongCoreCallback.ResultCallback<Boolean> callback)保存会话草稿信息。 abstract voidclearTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)删除指定会话中的草稿信息。 abstract voidinsertOutgoingMessage(ConversationType type, String targetId, String channelId, SentStatus sentStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)向本地会话中插入一条消息,方向为发送。 这条消息只是插入本地会话,不会实际发送给服务器和对方。 插入消息需为入库消息,即 ISPERSISTED,否者会回调 RC_INVALID_PARAMETER_MSG_TAG abstract voidinsertOutgoingMessage(ConversationType type, String targetId, String channelId, boolean canIncludeExpansion, SentStatus sentStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)abstract voidinsertIncomingMessage(ConversationType type, String targetId, String channelId, String senderUserId, ReceivedStatus receivedStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)向本地会话中插入一条消息,方向为接收。 这条消息只是插入本地会话,不会实际发送给服务器和对方。插入消息需为入库消息,即 ISPERSISTED,否者会回调 RC_INVALID_PARAMETER_MSG_TAG。 abstract voidsendMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.ISendMessageCallback callback)根据会话类型,发送消息。 通过 io.rong.imlib.IRongCoreCallback. abstract voidsendDirectionalMessage(ConversationType type, String targetId, String channelId, MessageContent content, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)发送定向消息。 此方法用于在群组和讨论组中发送消息给其中的部分用户,其它用户不会收到这条消息。 通过 io.rong.imlib.IRongCoreCallback. abstract voidsendDirectionalMessage(Message message, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)发送定向消息。 此方法用于在群组和讨论组中发送消息给其中的部分用户,其它用户不会收到这条消息。 通过 io.rong.imlib.IRongCoreCallback. abstract voidsendDirectionalMediaMessage(Message message, Array<String> userIds, String pushContent, String pushData, IRongCoreCallback.ISendMediaMessageCallback callback)发送定向多媒体消息。 向会话中特定的某些用户发送消息,会话中其他用户不会收到消息。 发送前构造 Message 消息实体,消息实体中的 content 必须为多媒体消息。 例如:ImageMessage 、 或其他继承自 MediaMessageContent 的消息。 abstract voidsendImageMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.SendImageMessageCallback callback)发送图片消息。 如果您使用IMLib,可以使用此方法发送图片消息; 如果您使用 IMKit,请使用 RongIM 中的同名方法发送图片消息,否则不会自动更新 UI。 abstract voiddownloadMedia(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.MediaType mediaType, String imageUrl, IRongCoreCallback.DownloadMediaCallback callback)下载多媒体文件。 如果本地缓存中包含此文件,则从本地缓存中直接获取,否则将从服务器端下载。 abstract voidgetConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)获取会话消息提醒状态。 注意:不支持聊天室! abstract voidsetConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, ConversationNotificationStatus notificationStatus, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)设置会话消息提醒状态。 注意:不支持聊天室! abstract voidclearConversations(IRongCoreCallback.ResultCallback callback, String channelId, Array<ConversationType> conversationTypes)清空指定会话类型列表中的所有会话及会话信息。(不支持超级群) abstract Collection<TypingStatus>getTypingUserListFromConversation(ConversationType conversationType, String targetId, String channelId)获取会话正在输入的用户列表 abstract voidsendTypingStatus(ConversationType conversationType, String targetId, String channelId, String typingContentType)向会话中发送正在输入的状态,目前只支持单聊。 abstract voidsendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp)发送某个会话中的消息阅读回执 使用 IMLib 可以注册监听 setReadReceiptListener;使用 IMkit 直接设置 rc_config. abstract voidsendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.ISendMessageCallback callback)发送某个会话中的消息阅读回执。 使用 IMLib 可以注册监听 setReadReceiptListener;使用 IMkit 直接设置 rc_config. abstract voidgetUnreadMentionedMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)获取会话中未读的 @ 消息。 abstract voidclearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)清除某个会话中的未读消息数。 注意:不支持聊天室,不支持超级群 abstract voidsendReadReceiptResponse(ConversationType type, String targetId, String channelId, List<Message> messageList, IRongCoreCallback.OperationCallback callback)发送已读回执(只支持群组和讨论组)。 abstract voidsyncConversationReadStatus(ConversationType type, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)同步会话阅读状态。 abstract voidsearchConversations(String keyword, Array<ConversationType> conversationTypes, String channelId, Array<String> objectNames, IRongCoreCallback.ResultCallback<List<SearchConversationResult>> resultCallback)根据关键字搜索会话。 此方法可快速返回匹配的会话列表,并且会话中包含已匹配的消息数量。通过 {SearchConversationResult#getMatchCount()} 得到。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。 abstract voidsearchMessages(ConversationType conversationType, String targetId, String channelId, String keyword, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)根据关键字搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。 abstract voidsearchMessages(ConversationType conversationType, String targetId, String channelId, String keyword, long startTime, long endTime, int offset, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)根据关键字,指定时间段搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。 abstract voidsearchMessagesByUser(ConversationType conversationType, String targetId, String channelId, String userId, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)根据用户 id 搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。 abstract voidsearchMessagesForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String keyword, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)根据用户id、会话业务标识、关键字等搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。 abstract voidsearchMessagesByUserForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)根据会话id、会话业务标识、用户ID等搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。 abstract voidsearchMessagesByUserForAllChannel(ConversationType conversationType, String targetId, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)根据会话id、用户id等搜索指定会话中的消息。(包含所有的 ChannelId) 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。 abstract voidgetHistoryMessages(ConversationType conversationType, String targetId, String channelId, long sentTime, int before, int after, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)在会话中搜索指定消息的前 before数量和after数量的消息。 返回的消息列表中会包含指定的消息。消息列表时间顺序从新到旧。 该方法仅获取本地数据库中的消息。 注意:since 5.4.abstract voidgetTheFirstUnreadMessage(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Message> callback)获取第一条未读消息。 abstract voidsetSyncConversationReadStatusListener(IConversationChannelListener.ConversationChannelSyncConversationReadStatusListener listener)设置多端同步会话阅读状态监听。 abstract voidsetConversationChannelTypingStatusListener(IConversationChannelListener.ConversationChannelTypingStatusListener listener)设置输入状态监听器。 当输入状态发生变化时,回调 onTypingStatusChanged (Conversation. abstract voidgetMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallback callback)获取指定会话历史消息。 此方法先从本地获取历史消息,本地有缺失的情况下会从服务端同步缺失的部分;从服务端同步失败的时候会返回非 0 的 errorCode,同时把本地能取到的消息回调上去。 必须开通历史消息云存储功能。 abstract voidgetMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallbackEx getMessageCallback)获取指定会话历史消息。 此方法先从本地获取历史消息,本地有缺失的情况下会从服务端同步缺失的部分;从服务端同步失败的时候会返回非 0 的 errorCode,同时把本地能取到的消息回调上去。 必须开通历史消息云存储功能。 abstract voidgetConversationTopStatus(String targetId, ConversationType conversationType, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)获取会话的置顶状态 同时设置 setConversationStatusListener 监听器,在onConversationTagChanged回调中更新会话置顶状态,保证会话置顶的准确性 此方法会从本地数据库中,读取该会话是否置顶。 abstract voidgetUnreadCount(String targetId, ConversationType conversationType, Array<String> objectNames, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)获取指定会话内指定消息类型的未读消息数(聊天室会话除外) abstract voidgetPrivateMessageDeliverTime(String uid, String channelId, IRongCoreCallback.ResultCallback<Long> callback)获取单聊某条消息的送达时间 abstract voidgetGroupMessageDeliverList(String uid, String targetId, String channelId, IRongCoreListener.IGetGroupMessageDeliverListCallback callback)获取群组消息送达列表(只支持群组) 只查询本地数据库中 UID 存在且发送方向为 SEND 对方已经接收的消息。 abstract voidgetMessageByUid(String uid, IRongCoreCallback.ResultCallback<Message> callback)通过全局唯一 id 获取消息实体。 abstract voidgetUltraGroupUnreadMentionedCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)获取超级群会话中被 @ 的消息数 注意:此方法只支持超级群的会话类型! abstract voidsendUltraGroupTypingStatus(String targetId, String channelId, IRongCoreEnum.UltraGroupTypingStatus typingStatus, IRongCoreCallback.OperationCallback callback)发送超级群输入状态 abstract voiddeleteUltraGroupMessagesForAllChannel(String targetId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)删除本地所有 channel 特定时间之前的消息 abstract voiddeleteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)删除本地特定 channel 特点时间之前的消息 abstract voiddeleteRemoteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)删除服务端特定 channel 特定时间之前的消息 abstract voidmodifyUltraGroupMessage(String msgUid, MessageContent content, IRongCoreCallback.OperationCallback callback)修改消息 注意:此方法只能修改相同频道的同类型消息,仅能修改自己发送的消息 abstract voidsyncUltraGroupReadStatus(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)上报超级群的已读时间 abstract voidsetUltraGroupReadTimeListener(IRongCoreListener.UltraGroupReadTimeListener listener)设置超级群已读时间回调监听器 此方法只支持超级群的会话类型 abstract voidsetUltraGroupTypingStatusListener(IRongCoreListener.UltraGroupTypingStatusListener listener)设置超级群输入状态监听器 abstract voidsetUltraGroupMessageChangeListener(IRongCoreListener.UltraGroupMessageChangeListener listener)设置超级群消息变更监听器 abstract voidupdateUltraGroupMessageExpansion(Map<String, String> expansion, String messageUId, IRongCoreCallback.OperationCallback callback)更新超级群消息扩展信息 每条消息携带扩展信息键值对最大值 300个,单次设置扩展信息键值对最大值 20个 abstract voidremoveUltraGroupMessageExpansion(String messageUId, List<String> keyArray, IRongCoreCallback.OperationCallback callback)删除超级群消息扩展信息中特定的键值对 abstract voidrecallUltraGroupMessage(Message message, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)撤回超级群消息 abstract voidrecallUltraGroupMessage(Message message, boolean isDelete, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)撤回超级群消息 abstract voidgetUltraGroupConversationListForAllChannel(IRongCoreCallback.ResultCallback<List<Conversation>> callback)获取超级群当前用户本地会话列表,该方法返回的是以下类型的会话列表:私聊,群组,讨论组,系统会话。 此方法会从本地数据库中,读取会话列表。返回的会话列表排序规则为:按照时间从前往后排列,如果有置顶的会话,则置顶的会话会排列在前面。 如果您需要获取其它类型的会话列表,可以使用getConversationList} 。 需要在连接数据库打开回调 OnDatabaseOpened后调用,IRongCoreCallback.ConnectCallback 。abstract voidgetBatchRemoteUltraGroupMessages(List<Message> msgList, IRongCoreCallback.IGetBatchRemoteUltraGroupMessageCallback callback)从服务获取批量消息 abstract voidgetConversationListForAllChannel(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<List<Conversation>> callback)获取特定会话下所有频道的会话列表(只支持单群聊,超级群,不支持聊天室) abstract voidsetNotificationQuietHoursLevel(String startTime, int spanMinutes, IRongCoreEnum.PushNotificationQuietHoursLevel level, IRongCoreCallback.OperationCallback callback)设置消息通知免打扰时间。 abstract voidremoveNotificationQuietHours(IRongCoreCallback.OperationCallback callback)移除消息通知免打扰时间。 abstract voidgetNotificationQuietHoursLevel(IRongCoreCallback.GetNotificationQuietHoursCallbackEx callback)获取消息通知免打扰时间。 abstract voidsetConversationChannelNotificationLevel(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)设置会话消息提醒状态。取消设置,请调用此方法,level 传入 PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE注意:不支持聊天室!注意:超级群通过该接口对具体频道进行免打扰设置 abstract voidsetConversationsNotificationLevel(List<ConversationIdentifier> conversationIdentifiers, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)异步批量设置会话的消息提醒状态 取消设置,请调用此方法,level 传入 * io.rong.imlib.IRongCoreEnum. abstract voidgetConversationChannelNotificationLevel(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)获取会话消息提醒状态。 注意:不支持聊天室! abstract voidsetConversationNotificationLevel(ConversationType conversationType, String targetId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)指定会话免打扰设置 注意:超级群调用该接口,相当于设置了 channelId 为 空 的频道的免打扰,不会屏蔽整个超级群会话下所有频道的免打扰 abstract voidgetConversationNotificationLevel(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)获取指定会话免打扰状态。 注意:不支持聊天室! abstract voidsetConversationTypeNotificationLevel(ConversationType conversationType, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)指定会话类型免打扰设置 按照特定会话类型进行免打扰设置 明确支持:单聊,群聊,超级群,系统会话 abstract voidgetConversationTypeNotificationLevel(ConversationType conversationType, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)获取指定会话类型免打扰状态。 注意:不支持聊天室! abstract voidgetUltraGroupConversationDefaultNotificationLevel(String targetId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)查询指定超级群默认通知配置 abstract voidgetUltraGroupConversationChannelDefaultNotificationLevel(String targetId, String channelId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)查询指定超级群指定频道默认通知配置 abstract voidsetUltraGroupConversationDefaultNotificationLevel(String targetId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)abstract voidsetUltraGroupConversationChannelDefaultNotificationLevel(String targetId, String channelId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)abstract voidgetUltraGroupUnreadCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)获取指定超级群下所有频道的未读消息总数 abstract voidgetUltraGroupAllUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback)获取超级群会话类型的所有未读消息数 abstract voidgetUltraGroupAllUnreadMentionedCount(IRongCoreCallback.ResultCallback<Integer> callback)获取超级群会话类型的@消息未读数接口 abstract voidsetUltraGroupConversationListener(IRongCoreListener.UltraGroupConversationListener listener)设置超级群会话监听器 abstract voidgetConversationListWithAllChannel(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)abstract voidgetConversationListWithAllChannelByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes, long timeStamp, int count)abstract voidsearchMessageForAllChannel(String targetId, ConversationType conversationType, String keyword, int count, long timestamp, IRongCoreCallback.ResultCallback<List<Message>> callback)abstract voidsearchMessageByTimestampForAllChannel(String targetId, ConversationType conversationType, String keyword, long startTime, long endTime, int offset, int limit, IRongCoreCallback.ResultCallback<List<Message>> callback)abstract voidsearchConversationForAllChannel(String keyword, Array<ConversationType> conversationTypes, Array<String> objName, IRongCoreCallback.ResultCallback<List<SearchConversationResult>> callback)abstract voidgetUltraGroupChannelList(String targetId, IRongCoreEnum.UltraGroupChannelType channelType, IRongCoreCallback.ResultCallback<List<Conversation>> callback)获取超级群频道列表 abstract voidsetUltraGroupChannelListener(IRongCoreListener.UltraGroupChannelListener listener)超级群频道事件监听 abstract voidgetUnreadCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)获取会话未读消息数 abstract voidgetUnreadMentionedCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)获取获取会话未读 @消息数abstract voidgetUltraGroupUnreadCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)获取指定超级群会话的未读消息数(包括所有频道) abstract voidgetUltraGroupUnreadMentionedCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)获取指定超级群会话的未读 @消息数(包括所有频道)abstract voidgetUnreadMentionedMessages(ConversationType conversationType, String targetId, String channelId, int count, boolean desc, IRongCoreCallback.ResultCallback<List<Message>> callback)abstract voidgetUltraGroupUnreadMentionedDigests(String targetId, String channelId, long sendTime, int count, IRongCoreCallback.ResultCallback<List<MessageDigestInfo>> callback)获取超级群会话类型未读的@消息摘要列表接口 abstract voidgetBatchLocalMessages(ConversationType conversationType, String targetId, String channelId, List<String> messageUIDs, IRongCoreCallback.IGetMessagesByUIDsCallback callback)abstract voidsetUserGroupStatusListener(IRongCoreListener.UserGroupStatusListener userGroupStatusListener)设置用户组状态监听器 abstract voidgetUltraGroupConversationUnreadInfoList(Array<String> targetIds, IRongCoreCallback.ResultCallback<List<ConversationUnreadInfo>> callback)根据超级群的TargetId数组,获取每个超级群下所有频道的会话的未读相关信息 abstract voidgetUltraGroupMessageCountByTimeRange(String targetId, Array<String> channelIds, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)获取某个超级群指定 channel 列表,某段时间范围内的消息数量,如果 channel_id_list 为空,则返回全部 channel id 的消息数量 abstract voidgetMessageCountByTimeRange(String targetId, ConversationType conversationType, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)获取某个会话某段时间范围内的消息数量,如果为超级群则需获取所有 channel id 的消息数量 abstract voidsendReadReceiptMessageV4(ConversationType conversationType, String targetId, String channelId, String startMessageUID, String endMessageUID, IRongCoreCallback.OperationCallback callback)发送已读回执v4(支持单群聊) abstract voidgetMessageReadReceiptV4(String targetId, String channelId, String messageUID, IRongCoreCallback.ResultCallbackEx<Integer, Integer, List<GroupMessageReader>> callback)获取消息已读用户列表(支持群组) -
-
Method Detail
-
getInstance
static ChannelClient getInstance()
- Since:
5.0.0
-
getConversationList
abstract void getConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId)
获取当前用户本地会话列表,该方法返回的是以下类型的会话列表:私聊,群组,讨论组,系统会话。
此方法会从本地数据库中,读取会话列表。返回的会话列表排序规则为:按照时间从前往后排列,如果有置顶的会话,则置顶的会话会排列在前面。
如果您需要获取其它类型的会话列表,可以使用getConversationList} 。
需要在连接数据库打开回调
OnDatabaseOpened后调用,IRongCoreCallback.ConnectCallback 。- Parameters:
callback- 获取会话列表的回调。channelId- 消息所属会话的业务标识。- Since:
5.1.1
-
getConversationList
abstract void getConversationList(String channelId, IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)
根据会话类型,获取当前用户的本地会话列表。
- Parameters:
channelId- 消息所属会话的业务标识。callback- 获取会话列表的回调。conversationTypes- 要获取的会话类型。- Since:
5.1.1
-
getTopConversationList
abstract void getTopConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)
根据会话类型,获取置顶会话列表
- Parameters:
channelId- 消息所属会话的业务标识。- Since:
5.1.1
-
getConversationListByPage
abstract void getConversationListByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, long timeStamp, int count, String channelId, Array<ConversationType> conversationTypes)
分页获取会话列表。
- Parameters:
callback- 获取会话列表的回调。timeStamp- 时间戳(毫秒),通过获取从此时间戳往前的会话,传入 0 表示从最新会话开始获取。参考 getSentTime 。count- 取回的会话数量。当实际取回的会话数量小于 count 值时,表明已取完数据。 建议此数值不要超过 10 个,当一次性获取的会话数过大时, 会导致跨进程通信崩溃,引发获取会话列表失败及通信连接被中断。channelId- 消息所属会话的业务标识。conversationTypes- 要获取的会话类型。- Since:
5.1.1
-
getBlockedConversationList
abstract void getBlockedConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)
获取免打扰的会话列表。
- Parameters:
callback- 获取免打扰会话的回调。channelId- 消息所属会话的业务标识。conversationTypes- 会话类型,io.rong.imlib.model.Conversation.- Since:
5.1.1
-
getUnreadConversationList
abstract void getUnreadConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)
根据会话类型,获取当前用户未读的本地会话列表。
- Parameters:
callback- 获取会话列表的回调。conversationTypes- 要获取的会话类型。该接口仅支持 单聊、群聊、系统三种会话类型,不支持聊天室、超级群。- Since:
5.3.2
-
getConversation
abstract void getConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Conversation> callback)
获取单个会话信息。
- Parameters:
conversationType- 会话类型。参考 io.rong.imlib.model.Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。callback- 获取会话信息的回调。- Since:
5.1.1
-
updateConversationInfo
abstract void updateConversationInfo(ConversationType conversationType, String targetId, String channelId, String title, String portrait, IRongCoreCallback.ResultCallback callback)
更新会话信息。
- Parameters:
conversationType- 会话类型 io.rong.imlib.model.Conversation.targetId- 会话 idchannelId- 消息所属会话的业务标识。title- 会话标题portrait- 会话头像callback- 回调- Since:
5.1.1
-
removeConversation
abstract void removeConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
从会话列表中移除某一会话。
此方法不删除会话内的消息。如果此会话中有新的消息,该会话将重新在会话列表中显示,并显示最近的历史消息。
- Parameters:
conversationType- 会话类型 io.rong.imlib.model.Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。callback- 移除会话是否成功的回调,回调类型是 Boolean,ResultCallback<Boolean>。- Since:
5.1.1
-
removeConversations
abstract void removeConversations(List<ConversationIdentifier> conversationIdentifiers, IRongCoreCallback.ResultCallback<Boolean> callback)
批量从会话列表中移除某一会话。
此方法不删除会话内的消息。如果此会话中有新的消息,该会话将重新在会话列表中显示,并显示最近的历史消息。
支持的会话类型:单聊, 群聊, 系统消息
- Parameters:
conversationIdentifiers- 会话标识列表,最大数量为 20callback- 移除会话是否成功的回调,回调类型是 Boolean,ResultCallback<Boolean>。- Since:
5.6.7
-
setConversationToTop
abstract void setConversationToTop(ConversationType conversationType, String id, String channelId, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)
设置会话的置顶状态。
若会话不存在,调用此方法 SDK 自动创建会话并置顶。
- Parameters:
conversationType- 会话类型 io.rong.imlib.model.Conversation.id- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。isTop- 是否置顶。needCreate- 会话不存在时,是否创建会话。callback- 设置置顶是否成功的回调。- Since:
5.1.1
-
setConversationsToTop
abstract void setConversationsToTop(List<ConversationIdentifier> conversationIdentifiers, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)
异步批量设置会话的置顶状态
- Parameters:
conversationIdentifiers- 会话标识列表,最大数量为 20isTop- 是否置顶needCreate- 在没有会话时,是否创建会话callback- 回调结果- Since:
5.6.7
-
getTotalUnreadCount
abstract void getTotalUnreadCount(String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取所有会话的总未读消息数。
注意:不包含聊天室,聊天室消息不计数。
- Parameters:
channelId- 消息所属会话的业务标识callback- 未读消息数的回调。- Since:
5.1.1
-
getTotalUnreadCount
abstract void getTotalUnreadCount(String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)
- Since:
5.2.3
-
getUnreadCount
abstract void getUnreadCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话的未读消息数。
注意:不包含聊天室,聊天室消息不计数。
- Parameters:
conversationType- 会话类型 io.rong.imlib.model.Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。callback- 未读消息数的回调。- Since:
5.1.1
-
getUnreadCount
abstract void getUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback, String channelId, Array<ConversationType> conversationTypes)
获取指定会话类型的总未读消息数。
注意:不包含聊天室,聊天室消息不计数。
- Parameters:
callback- 未读消息数的回调。channelId- 消息所属会话的业务标识。conversationTypes- 会话类型,可传多个会话类型。- Since:
5.1.1
-
getUnreadCount
abstract void getUnreadCount(Array<ConversationType> conversationTypes, String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话类型的总未读消息数。
注意:不包含聊天室,聊天室消息不计数。
- Parameters:
conversationTypes- 会话类型数组 io.rong.imlib.model.Conversation.channelId- 消息所属会话的业务标识。containBlocked- 是否包含免打扰消息的未读消息数。callback- 未读消息数的回调。- Since:
5.1.1
-
getMessageCount
abstract void getMessageCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话的消息总数。
- Parameters:
conversationType- 会话类型 io.rong.imlib.model.Conversation.targetId- 会话 id。channelId- 消息所属会话的业务标识。callback- 消息总数的回调。- Since:
5.1.1
-
getLatestMessages
abstract void getLatestMessages(ConversationType conversationType, String targetId, String channelId, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取指定会话的最新消息。
- Parameters:
conversationType- 会话类型 io.rong.imlib.model.Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。count- 需要获取的消息数量。callback- 获取最新消息的回调,按照时间顺序从新到旧排列,如果会话中的消息数量小于参数 count 的值,会将该会话中的所有消息返回。- Since:
5.1.1
-
getHistoryMessages
abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, String objectName, int oldestMessageId, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取会话中符合条件的消息列表。
返回的消息中不包含 oldestMessageId 对应那条消息,如果会话中的消息数量小于参数 count 的值,会将该会话中的所有消息返回。
如:oldestMessageId 为 10,count 为 2,会返回 messageId 为 9 和 8 的 Message 对象列表。
注意:不支持拉取聊天室 CHATROOM 历史消息
该方法仅获取本地数据库中的消息。
注意:since 5.4.4版本该方法支持超级群类型。超级群不会接收离线消息,超级群调用该接口会出现消息断档的情况,请使用断档消息接口获取超级群消息。
- Parameters:
conversationType- 会话类型 ,不支持聊天室。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 。channelId- 消息所属会话的业务标识。objectName- 消息类型标识。oldestMessageId- 最后一条消息的 Id,获取此消息之前的 count 条消息,没有消息第一次调用应设置为:-1。count- 要获取的消息数量callback- 获取历史消息的回调,按照时间顺序从新到旧排列。- Since:
5.1.1
-
getHistoryMessages
abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, String objectName, int baseMessageId, int count, RongCommonDefine.GetMessageDirection direction, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取会话中符合条件的消息列表。
如:获取 messageId 为 22 的之前的 10条 图片消息,则相应参数为 getHistoryMessages(conversationType, targetId, "RC:ImgMsg", 22, 10, true, resultCallback)。
注意:不支持拉取聊天室 CHATROOM 历史消息
该方法仅获取本地数据库中的消息。
注意:since 5.4.4版本该方法支持超级群类型。超级群不会接收离线消息,超级群调用该接口会出现消息断档的情况,请使用断档消息接口获取超级群消息。
- Parameters:
conversationType- 会话类型 ,不支持聊天室。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。objectName- 消息类型标识。如 RC:TxtMsg,RC:ImgMsg,RC:VcMsg 等 value 。baseMessageId- 起始消息 id。count- 需要获取的消息数量。direction- 要获取的消息相对于 baseMessageId 的方向 以指定的 baseMessageId 作为获取的起始点,时间早于 baseMessageId 则为 FRONT,晚于则为 BEHIND。callback- 获取历史消息的回调,按照时间顺序从新到旧排列。- Since:
5.1.1
-
getHistoryMessages
abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, List<String> objectNames, long timestamp, int count, RongCommonDefine.GetMessageDirection direction, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取会话中符合条件的消息列表。
如: 要获取 messageId 为 22 的之前的 10 条图片消息,和文字消息 objectNames 为字符串 List
objectNames.add("RC:ImgMsg"); objectNames.add("RC:TxtMsg");则相应参数为 getHistoryMessages(conversationType, targetId, objectNames, 22, 10, true, resultCallback)。
该方法仅获取本地数据库中的消息。
注意:since 5.4.4版本该方法支持超级群类型。超级群不会接收离线消息,超级群调用该接口会出现消息断档的情况,请使用断档消息接口获取超级群消息。
- Parameters:
conversationType- 会话类型 ,不支持聊天室。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。objectNames- 消息类型标识 List。如 RC:TxtMsg,RC:ImgMsg,RC:VcMsg 等构成的 List。timestamp- 当前消息时间戳。count- 需要获取的消息数量。direction- 要获取的消息相对于当前消息的方向 io.rong.imlib.RongCommonDefine.callback- 获取历史消息的回调,按照时间顺序从新到旧排列。- Since:
5.1.1
-
getRemoteHistoryMessages
abstract void getRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long dateTime, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)
从服务器端获取指定时间之前的历史消息。(不支持超级群)
区别于 getHistoryMessages,该接口是从融云服务器中拉取。从服务端拉取消息后,客户端会做排重,返回排重后的数据。通常用于更换新设备后,拉取历史消息。 使用的时候,建议优先通过 getHistoryMessages 从本地数据库拉取历史消息, 当本地数据库没有历史消息后,再通过此接口获取服务器历史消息,时间戳传入本地数据库里最早的消息时间戳。注意: 1. 此功能需要在融云开发者后台开启历史消息云存储功能。 2. 当本地数据库中已存在将要获取的消息时,此接口不会再返回数据。
- Parameters:
conversationType- 会话类型。targetId- 目标会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。dateTime- 从该时间点开始获取消息。即:消息中的 sentTime getSentTime;如果本地库中没有消息,第一次可传 0,否则传入最早消息的sentTime,获取最新 count 条。count- 需要获取的消息数量,1 < count <= 20。callback- 获取历史消息的回调,按照时间顺序从新到旧排列。- Since:
5.1.1
-
getRemoteHistoryMessages
abstract void getRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, RemoteHistoryMsgOption remoteHistoryMsgOption, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取指定会话远端历史消息。(不支持超级群)
此功能需要在融云开发者后台开启历史消息云存储功能。注意:不支持聊天室!
- Parameters:
conversationType- 会话类型,不支持聊天室。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。remoteHistoryMsgOption- 可配置的参数 RemoteHistoryMsgOptioncallback- 获取历史消息的回调,按照时间顺序从新到旧排列。- Since:
5.1.1
-
cleanRemoteHistoryMessages
abstract void cleanRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, IRongCoreCallback.OperationCallback callback)
清除服务器上存储的历史消息。
根据会话类型和目标会话 id 清除某一会话指定时间戳之前的服务端历史消息, 清除成功后只能从服务端获取到该时间戳之后的历史消息。
注意:必须先开通历史消息云存储功能!
- Parameters:
conversationType- 会话类型。targetId- 会话 id。channelId- 消息所属会话的业务标识。recordTime- 清除消息截止时间戳,0 <= recordTime <= 当前会话最后一条消息的 sentTime,0 清除所有消息,其他值清除小于等于 recordTime 的消息。callback- 清除消息的回调。- Since:
5.1.1
-
cleanHistoryMessages
abstract void cleanHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, boolean cleanRemote, IRongCoreCallback.OperationCallback callback)
删除指定时间戳之前的消息,可选择是否同时删除服务器端消息
此方法可从服务器端清除历史消息,但是必须先开通历史消息云存储功能。
根据会话类型和会话 id 清除某一会话指定时间戳之前的本地数据库消息(服务端历史消息), 清除成功后只能从本地数据库(服务端)获取到该时间戳之后的历史消息。
- Parameters:
conversationType- 会话类型。targetId- 会话 id。channelId- 消息所属会话的业务标识。recordTime- 清除消息截止时间戳,0 <= recordTime <= 当前会话最后一条消息的 sentTime,0 清除所有消息,其他值清除小于等于 recordTime 的消息。cleanRemote- 是否删除服务器端消息callback- 清除消息的回调。- Since:
5.1.1
-
getHistoryMessages
abstract void getHistoryMessages(ConversationType conversationType, String targetId, int oldestMessageId, int count, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取会话中,从指定消息之前、指定数量的、指定消息类型的最新消息实体。
注意:不支持聊天室!
该方法仅获取本地数据库中的消息。
注意:since 5.4.4版本该方法支持超级群类型。超级群不会接收离线消息,超级群调用该接口会出现消息断档的情况,请使用断档消息接口获取超级群消息。
- Parameters:
conversationType- 会话类型,不支持聊天室。参考 Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。oldestMessageId- 最后一条消息的 id。获取此消息之前的 count 条消息,没有消息第一次调用应设置为 -1。count- 要获取的消息数量。channelId- 消息所属会话的业务标识。callback- 获取历史消息的回调,按照时间顺序从新到旧排列。- Since:
5.1.1
-
deleteMessages
abstract void deleteMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
删除某个会话中的所有消息。
此接口删除指定会话中数据库的所有消息,同时会清理数据库空间,减少占用空间。
- Parameters:
conversationType- 会话类型,不支持聊天室。参考 Conversation.targetId- 会话 id。根据不同的 conversationType,可能是 userId, groupId, discussionId。channelId- 消息所属会话的业务标识。callback- 删除是否成功的回调。- Since:
5.1.1
-
deleteRemoteMessages
abstract void deleteRemoteMessages(ConversationType conversationType, String targetId, String channelId, Array<Message> messages, IRongCoreCallback.OperationCallback callback)
批量删除某个会话中的指定远端消息(同时删除对应的本地消息)。
一次批量操作仅支持删除属于同一个会话的消息,请确保消息列表中的所有消息来自同一会话,一次最多删除 100 条消息。
注意:不支持聊天室、超级群!
- Parameters:
conversationType- 会话类型, 不支持聊天室、超级群。参考 Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、客服 id。channelId- 消息所属会话的业务标识。messages- 要删除的消息数组, 数组大小不能超过 100 条。callback- 删除是否成功的回调。- Since:
5.1.1
-
clearMessages
abstract void clearMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
删除某个会话中的所有消息。
注意:不支持聊天室!
- Parameters:
conversationType- 会话类型,不支持聊天室。参考 Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。callback- 清空是否成功的回调。- Since:
5.1.1
-
clearMessages
abstract void clearMessages(List<ClearMessageOption> clearMessageOptions, IRongCoreCallback.ResultCallback<Boolean> callback)
异步批量删除指定会话早于(含)发送时间的所有本地数据库消息。
此方法删除数据库中会话早于(含)发送时间的消息记录, 时间戳传 0 清除所有消息
支持的会话类型:单聊, 群聊, 聊天室, 系统消息
- Parameters:
clearMessageOptions- 删除消息参数列表,最大数量为 20callback- 删除是否成功的回调。- Since:
5.6.7
-
clearRemoteMessages
abstract void clearRemoteMessages(List<ClearMessageOption> clearMessageOptions, boolean isDeleteLocal, IRongCoreCallback.OperationCallback callback)
异步批量删除服务端指定会话早于(含)发送时间的所有远端消息(可以删除对应的本地消息)
时间戳传 0 清除所有消息
支持的会话类型:单聊, 群聊, 聊天室, 系统消息
- Parameters:
clearMessageOptions- 删除消息参数列表,最大数量为 20isDeleteLocal- 是否删除本地消息callback- 删除是否成功的回调。- Since:
5.6.7
-
clearMessagesUnreadStatus
abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
清除某个会话中的未读消息数。
注意:不支持聊天室,不支持超级群
- Parameters:
conversationType- 会话类型,不支持聊天室。参考 Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。callback- 清除是否成功的回调。- Since:
5.1.1
-
getTextMessageDraft
abstract void getTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<String> callback)
获取会话中的草稿信息。
- Parameters:
conversationType- 会话类型。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。callback- 获取草稿文字内容的回调。- Since:
5.1.1
-
saveTextMessageDraft
abstract void saveTextMessageDraft(ConversationType conversationType, String targetId, String channelId, String content, IRongCoreCallback.ResultCallback<Boolean> callback)
保存会话草稿信息。
- Parameters:
conversationType- 会话类型。参考 io.rong.imlib.model.Conversation.targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。content- 草稿的文字内容。callback- 是否保存成功的回调。- Since:
5.1.1
-
clearTextMessageDraft
abstract void clearTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
删除指定会话中的草稿信息。
- Parameters:
conversationType- 会话类型。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。callback- 是否清除成功的回调。- Since:
5.1.1
-
insertOutgoingMessage
abstract void insertOutgoingMessage(ConversationType type, String targetId, String channelId, SentStatus sentStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)
向本地会话中插入一条消息,方向为发送。
这条消息只是插入本地会话,不会实际发送给服务器和对方。
插入消息需为入库消息,即 ISPERSISTED,否者会回调 RC_INVALID_PARAMETER_MSG_TAG
- Parameters:
type- 会话类型。targetId- 会话 id。比如私人会话时,是对方的 id; 群组会话时,是群 id; 讨论组会话时,则为该讨论组的 id。channelId- 消息所属会话的业务标识。sentStatus- 发送状态 Message.content- 消息内容。如io.rong.message.sentTime- 消息的发送时间 getSentTime 。resultCallback- 获得消息发送实体的回调。- Since:
5.1.1
-
insertOutgoingMessage
abstract void insertOutgoingMessage(ConversationType type, String targetId, String channelId, boolean canIncludeExpansion, SentStatus sentStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)
- Since:
5.2.4
-
insertIncomingMessage
abstract void insertIncomingMessage(ConversationType type, String targetId, String channelId, String senderUserId, ReceivedStatus receivedStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)
向本地会话中插入一条消息,方向为接收。
这条消息只是插入本地会话,不会实际发送给服务器和对方。插入消息需为入库消息,即 ISPERSISTED,否者会回调 RC_INVALID_PARAMETER_MSG_TAG。
- Parameters:
type- 会话类型。targetId- 会话 id。比如私人会话时,是对方的 id; 群组会话时,是群 id; 讨论组会话时,则为该讨论组的 id。channelId- 消息所属会话的业务标识。senderUserId- 发送方 idreceivedStatus- 接收状态 Message.content- 消息内容。如 TextMessageio.rong.message.sentTime- 消息的发送时间 getSentTime 。resultCallback- 获得消息发送实体的回调。- Since:
5.1.1
-
sendMessage
abstract void sendMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.ISendMessageCallback callback)
根据会话类型,发送消息。
通过 io.rong.imlib.IRongCoreCallback.ISendMessageCallback 中的方法回调发送的消息状态及消息体。 注意:1 秒钟发送消息不能超过 5 条。
- Parameters:
type- 会话类型。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。content- 消息内容,例如 io.rong.message.pushContent- 当下发远程推送消息时,在通知栏里会显示这个字段。 如果发送的是自定义消息,该字段必须填写,否则无法收到远程推送消息。 如果发送 SDK 中默认的消息类型,例如 RC:TxtMsg, RC:VcMsg, RC:ImgMsg,则不需要填写,默认已经指定。pushData- 远程推送附加信息。如果设置该字段,用户在收到 push 消息时,能通过 getPushData 方法获取。callback- 发送消息的回调。参考 io.rong.imlib.IRongCoreCallback.- Since:
5.1.1
-
sendDirectionalMessage
abstract void sendDirectionalMessage(ConversationType type, String targetId, String channelId, MessageContent content, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)
发送定向消息。
此方法用于在群组和讨论组中发送消息给其中的部分用户,其它用户不会收到这条消息。
通过 io.rong.imlib.IRongCoreCallback.ISendMessageCallback 中的方法回调发送的消息状态及消息体。
此方法只能发送非多媒体消息,多媒体消息如io.rong.message.ImageMessage 或其他继承自 io.rong.message.MediaMessageContent 的消息须调用 sendDirectionalMessage
如果您使用 IMLib,可以使用此方法发送定向消息;如果您使用 IMKit,请使用 RongIM 中的同名方法发送定向消息,否则不会自动更新 UI。
- Parameters:
type- 会话类型。targetId- 会话 id。只能是讨论组 id 或群组 id。channelId- 消息所属会话的业务标识。content- 消息内容,例如 io.rong.message.userIds- 讨论组或群组会话中将会接收到此消息的用户列表。pushContent- 当下发远程推送消息时,在通知栏里会显示这个字段。 如果发送的是自定义消息,该字段必须填写,否则无法收到远程推送消息。 如果发送 SDK 中默认的消息类型,例如 RC:TxtMsg, RC:VcMsg, RC:ImgMsg,则不需要填写,默认已经指定。pushData- 远程推送附加信息。如果设置该字段,用户在收到远程推送消息时,能通过 getPushData 方法获取。option- 发送消息附加选项,目前仅支持设置 isVoIPPush,如果对端设备是 iOS,设置 isVoIPPush 为 True,会走 VoIP 通道推送 Push。callback- 发送消息的回调,参考 io.rong.imlib.IRongCoreCallback.- Since:
5.1.1
-
sendDirectionalMessage
abstract void sendDirectionalMessage(Message message, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)
发送定向消息。
此方法用于在群组和讨论组中发送消息给其中的部分用户,其它用户不会收到这条消息。
通过 io.rong.imlib.IRongCoreCallback.ISendMessageCallback 中的方法回调发送的消息状态及消息体。
此方法只能发送非多媒体消息,多媒体消息如io.rong.message.ImageMessage 或其他继承自 io.rong.message.MediaMessageContent 的消息须调用 sendDirectionalMessage
如果您使用 IMLib,可以使用此方法发送定向消息;如果您使用 IMKit,请使用 RongIM 中的同名方法发送定向消息,否则不会自动更新 UI。
- Parameters:
message- 发送消息的实体。userIds- 讨论组或群组会话中将会接收到此消息的用户列表。pushContent- 当下发远程推送消息时,在通知栏里会显示这个字段。 如果发送的是自定义消息,该字段必须填写,否则无法收到远程推送消息。 如果发送 SDK 中默认的消息类型,例如 RC:TxtMsg, RC:VcMsg, RC:ImgMsg,则不需要填写,默认已经指定。pushData- 远程推送附加信息。如果设置该字段,用户在收到远程推送消息时,能通过 getPushData 方法获取。option- 发送消息附加选项,目前仅支持设置 isVoIPPush,如果对端设备是 iOS,设置 isVoIPPush 为 True,会走 VoIP 通道推送 Push。callback- 发送消息的回调,参考 io.rong.imlib.IRongCoreCallback.- Since:
5.2.3
-
sendDirectionalMediaMessage
abstract void sendDirectionalMediaMessage(Message message, Array<String> userIds, String pushContent, String pushData, IRongCoreCallback.ISendMediaMessageCallback callback)
发送定向多媒体消息。
向会话中特定的某些用户发送消息,会话中其他用户不会收到消息。 发送前构造 Message 消息实体,消息实体中的 content 必须为多媒体消息。 例如:ImageMessage 、 或其他继承自 MediaMessageContent 的消息。
- Parameters:
message- 发送消息的实体。userIds- 定向接收者 id 数组。pushContent- 当下发远程推送消息时,在通知栏里会显示这个字段。 如果发送的是自定义消息,该字段必须填写,否则无法收到远程推送消息。 如果发送 SDK 中默认的消息类型,例如: RC:TxtMsg, RC:VcMsg, RC:ImgMsg,则不需要填写,默认已经指定。pushData- 远程推送附加信息。如果设置该字段,用户在收到远程推送消息时,能通过 getPushData 方法获取。callback- 发送消息的回调 IRongCoreCallback.SendMediaMessageCallback。- Since:
5.2.4
-
sendImageMessage
abstract void sendImageMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.SendImageMessageCallback callback)
发送图片消息。
如果您使用IMLib,可以使用此方法发送图片消息;
如果您使用 IMKit,请使用 RongIM 中的同名方法发送图片消息,否则不会自动更新 UI。
- Parameters:
type- 会话类型。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。content- 消息内容,例如 TextMessage, io.rong.message.pushContent- 当下发远程推送消息时,在通知栏里会显示这个字段。 如果发送的是自定义消息,该字段必须填写,否则无法收到远程推送消息。 如果发送 SDK 中默认的消息类型,例如 RC:TxtMsg, RC:VcMsg, RC:ImgMsg,则不需要填写,默认已经指定。pushData- 远程推送附加信息。如果设置该字段,用户在收到远程推送消息时,能通过 getPushData 方法获取。callback- 发送消息的回调。参考 IRongCoreCallback.SendImageMessageCallback。- Since:
5.1.1
-
downloadMedia
abstract void downloadMedia(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.MediaType mediaType, String imageUrl, IRongCoreCallback.DownloadMediaCallback callback)
下载多媒体文件。
如果本地缓存中包含此文件,则从本地缓存中直接获取,否则将从服务器端下载。
- Parameters:
conversationType- 会话类型。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。mediaType- 文件类型。imageUrl- 文件的 URL 地址。callback- 下载文件的回调。- Since:
5.1.1
-
getConversationNotificationStatus
abstract void getConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)
获取会话消息提醒状态。
注意:不支持聊天室!
- Parameters:
conversationType- 会话类型,不支持聊天室(聊天室默认是不接受会话消息提醒的)。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。callback- 获取消息提醒状态的回调。- Since:
5.1.1
-
setConversationNotificationStatus
abstract void setConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, ConversationNotificationStatus notificationStatus, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)
设置会话消息提醒状态。
注意:不支持聊天室!
- Parameters:
conversationType- 会话类型。不支持聊天室类型,因为聊天室默认就是不接受消息提醒的。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。notificationStatus- 会话设置的消息提醒状态 。callback- 设置状态的回调。- Since:
5.1.1
-
clearConversations
abstract void clearConversations(IRongCoreCallback.ResultCallback callback, String channelId, Array<ConversationType> conversationTypes)
清空指定会话类型列表中的所有会话及会话信息。(不支持超级群)
- Parameters:
callback- 是否清空成功的回调。channelId- 消息所属会话的业务标识。conversationTypes- 需要清空的会话类型列表。- Since:
5.1.1
-
getTypingUserListFromConversation
abstract Collection<TypingStatus> getTypingUserListFromConversation(ConversationType conversationType, String targetId, String channelId)
获取会话正在输入的用户列表
- Parameters:
conversationType- 会话类型targetId- 会话 idchannelId- 消息所属会话的业务标识- Returns:
会话正在输入的用户列表
- Since:
5.1.1
-
sendTypingStatus
abstract void sendTypingStatus(ConversationType conversationType, String targetId, String channelId, String typingContentType)
向会话中发送正在输入的状态,目前只支持单聊。
- Parameters:
conversationType- 会话类型targetId- 会话 idchannelId- 消息所属会话的业务标识typingContentType- 正在输入的消息的类型名, typingContentType 为用户当前正在编辑的消息类型名,即 Message 中 getObjectName 的返回值。 如文本消息,传类型名 "RC:TxtMsg"。- Since:
5.1.1
-
sendReadReceiptMessage
abstract void sendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp)
发送某个会话中的消息阅读回执
使用 IMLib 可以注册监听 setReadReceiptListener;使用 IMkit 直接设置 rc_config.xml 中
rc_read_receipt为 true。- Parameters:
conversationType- 会话类型(只适用 PRIVATE 和 ENCRYPTED 类型)targetId- 会话 idchannelId- 消息所属会话的业务标识。timestamp- 该会话中已读的最后一条消息的发送时间戳getSentTime- Since:
5.1.1
-
sendReadReceiptMessage
abstract void sendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.ISendMessageCallback callback)
发送某个会话中的消息阅读回执。
使用 IMLib 可以注册监听 setReadReceiptListener;使用 IMkit 直接设置 rc_config.xml 中
rc_read_receipt为 true。- Parameters:
conversationType- 会话类型(只适用 PRIVATE 和 ENCRYPTED 类型)targetId- 会话 idchannelId- 消息所属会话的业务标识。timestamp- 会话中已读的最后一条消息的发送时间戳 getSentTimecallback- 发送已读回执消息的回调- Since:
5.1.1
-
getUnreadMentionedMessages
abstract void getUnreadMentionedMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取会话中未读的 @ 消息。
- Parameters:
conversationType- 会话类型。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。callback- 获取未读 @ 消息的回调。回调里返回的消息列表,按照时间顺序从旧到新。- Since:
5.1.1
-
clearMessagesUnreadStatus
abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
清除某个会话中的未读消息数。
注意:不支持聊天室,不支持超级群
- Parameters:
conversationType- 会话类型,不支持聊天室。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。timestamp- 该会话已阅读的最后一条消息的发送时间戳。参考 getSentTime。callback- 清除是否成功的回调。- Since:
5.1.1
-
sendReadReceiptResponse
abstract void sendReadReceiptResponse(ConversationType type, String targetId, String channelId, List<Message> messageList, IRongCoreCallback.OperationCallback callback)
发送已读回执(只支持群组和讨论组)。
- Parameters:
type- 会话类型targetId- 会话 idchannelId- 消息所属会话的业务标识。messageList- 会话中需要发送已读回执的消息列表callback- 回调函数- Since:
5.1.1
-
syncConversationReadStatus
abstract void syncConversationReadStatus(ConversationType type, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
同步会话阅读状态。
- Parameters:
type- 会话类型targetId- 会话 idchannelId- 消息所属会话的业务标识。timestamp- 会话中已读的最后一条消息的发送时间戳 getSentTimecallback- 回调函数- Since:
5.1.1
-
searchConversations
abstract void searchConversations(String keyword, Array<ConversationType> conversationTypes, String channelId, Array<String> objectNames, IRongCoreCallback.ResultCallback<List<SearchConversationResult>> resultCallback)
根据关键字搜索会话。
此方法可快速返回匹配的会话列表,并且会话中包含已匹配的消息数量。通过 {SearchConversationResult#getMatchCount()} 得到。
注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
- Parameters:
keyword- 搜索的关键字。conversationTypes- 搜索的会话类型。注意:包含超级群会话类型时,超级群会话只搜索已存储到本地的消息记录。channelId- 消息所属会话的业务标识。objectNames- 搜索的消息类型,例如:RC:TxtMsg。resultCallback- 搜索结果回调。- Since:
5.1.1
-
searchMessages
abstract void searchMessages(ConversationType conversationType, String targetId, String channelId, String keyword, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据关键字搜索指定会话中的消息。
注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。
- Parameters:
conversationType- 指定的会话类型。targetId- 指定的会话 id。channelId- 消息所属会话的业务标识。keyword- 搜索的关键字。count- 返回的搜索结果数量, 传 0 时会返回所有搜索到的消息, 非 0 时,逐页返回。beginTime- 查询 beginTime 之前的消息, 传 0 时从最新消息开始搜索,从该时间往前搜索。resultCallback- 搜索结果回调。- Since:
5.1.1
-
searchMessages
abstract void searchMessages(ConversationType conversationType, String targetId, String channelId, String keyword, long startTime, long endTime, int offset, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据关键字,指定时间段搜索指定会话中的消息。
注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。
- Parameters:
conversationType- 指定的会话类型。targetId- 指定的会话 id。channelId- 消息所属会话的业务标识。keyword- 搜索的关键字。startTime- 开始时间endTime- 结束时间offset- 偏移量limit- 返回的搜索结果数量,limit 需大于 0,最大值为 100,如果大于 100,会默认成 100resultCallback- 搜索结果回调。- Since:
5.1.2
-
searchMessagesByUser
abstract void searchMessagesByUser(ConversationType conversationType, String targetId, String channelId, String userId, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据用户 id 搜索指定会话中的消息。
注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。
- Parameters:
conversationType- 指定的会话类型。targetId- 指定的会话 id。channelId- 消息所属会话的业务标识。userId- 用户 id。count- 返回的搜索结果数量0 < count <= 100,如果count > 100,则返回 100。beginTime- 查询记录的起始时间, 传 0 时从最新消息开始搜索,从该时间往前搜索。resultCallback- 搜索结果回调。- Since:
5.1.1
-
searchMessagesForChannels
abstract void searchMessagesForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String keyword, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据用户id、会话业务标识、关键字等搜索指定会话中的消息。
注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
- Parameters:
conversationType- 指定的会话类型。targetId- 指定的会话 id。channelIds- 消息所属会话的业务标识。(0 <channelIds的数量 <= 50, 不符合则返回 RC_INVALID_PARAMETER_CHANNEL_ID)keyword- 关键词。(0<长度<=1000)startTime- 查询记录的起始时间, 传 0 时从最新消息开始搜索,从该时间往前搜索。limit- 返回的搜索结果数量0 < limit <= 100,如果limit > 100,则返回 100。resultCallback- 搜索结果回调。- Since:
5.6.2
-
searchMessagesByUserForChannels
abstract void searchMessagesByUserForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据会话id、会话业务标识、用户ID等搜索指定会话中的消息。
注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
- Parameters:
conversationType- 指定的会话类型。targetId- 指定的会话 id。channelIds- 消息所属会话的业务标识。(0 <channelIds的数量 <= 50, 不符合则返回 RC_INVALID_PARAMETER_CHANNEL_ID)userId- 用户ID。startTime- 查询记录的起始时间, 传 0 时从最新消息开始搜索,从该时间往前搜索。limit- 返回的搜索结果数量0 < limit <= 100,如果limit > 100,则返回 100。resultCallback- 搜索结果回调。- Since:
5.6.2
-
searchMessagesByUserForAllChannel
abstract void searchMessagesByUserForAllChannel(ConversationType conversationType, String targetId, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据会话id、用户id等搜索指定会话中的消息。(包含所有的 ChannelId)
注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
- Parameters:
conversationType- 指定的会话类型。targetId- 指定的会话 id。userId- 用户ID。startTime- 查询记录的起始时间, 传 0 时从最新消息开始搜索,从该时间往前搜索。limit- 返回的搜索结果数量0 < limit <= 100,如果limit > 100,则返回 100。resultCallback- 搜索结果回调。- Since:
5.6.2
-
getHistoryMessages
abstract void getHistoryMessages(ConversationType conversationType, String targetId, String channelId, long sentTime, int before, int after, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
在会话中搜索指定消息的前
before数量和after数量的消息。返回的消息列表中会包含指定的消息。消息列表时间顺序从新到旧。
该方法仅获取本地数据库中的消息。
注意:since 5.4.4版本该方法支持超级群类型。超级群不会接收离线消息,超级群调用该接口会出现消息断档的情况,请使用断档消息接口获取超级群消息。
- Parameters:
conversationType- 指定的会话类型。targetId- 指定的会话 id。channelId- 消息所属会话的业务标识。sentTime- 指定消息的发送时间,不能为 0。before- 指定消息的前部分消息数量。after- 指定消息的后部分消息数量。resultCallback- 搜索结果回调。 上拉加载时,返回数据中包含当前消息;例:当前消息 id 为 500, before = 0 after = 10,返回 510 - 500 ,按消息 id 倒序。- Since:
5.1.1
-
getTheFirstUnreadMessage
abstract void getTheFirstUnreadMessage(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Message> callback)
获取第一条未读消息。
- Parameters:
conversationType- 会话类型targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。callback- 回调- Since:
5.1.1
-
setSyncConversationReadStatusListener
abstract void setSyncConversationReadStatusListener(IConversationChannelListener.ConversationChannelSyncConversationReadStatusListener listener)
设置多端同步会话阅读状态监听。
- Parameters:
listener- 多端同步会话阅读状态监听 。- Since:
5.1.1
-
setConversationChannelTypingStatusListener
abstract void setConversationChannelTypingStatusListener(IConversationChannelListener.ConversationChannelTypingStatusListener listener)
设置输入状态监听器。
当输入状态发生变化时,回调 onTypingStatusChanged (Conversation.ConversationType, String, String, Collection)} 对于单聊而言,当对方正在输入时,监听会触发一次;当对方不处于输入状态时,该监听还会触发一次,但回调里输入用户列表为空。
- Parameters:
listener- 输入状态监听器- Since:
5.1.1
-
getMessages
abstract void getMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallback callback)
获取指定会话历史消息。
此方法先从本地获取历史消息,本地有缺失的情况下会从服务端同步缺失的部分;从服务端同步失败的时候会返回非 0 的 errorCode,同时把本地能取到的消息回调上去。 必须开通历史消息云存储功能。
- Parameters:
conversationType- 会话类型targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。historyMessageOption- HistoryMessageOptioncallback- 回调- Since:
5.1.2
-
getMessages
abstract void getMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallbackEx getMessageCallback)
获取指定会话历史消息。
此方法先从本地获取历史消息,本地有缺失的情况下会从服务端同步缺失的部分;从服务端同步失败的时候会返回非 0 的 errorCode,同时把本地能取到的消息回调上去。 必须开通历史消息云存储功能。
- Parameters:
conversationType- 会话类型targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id 或聊天室 id。channelId- 消息所属会话的业务标识。historyMessageOption- HistoryMessageOptiongetMessageCallback- 回调- Since:
5.1.2
-
getConversationTopStatus
abstract void getConversationTopStatus(String targetId, ConversationType conversationType, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
获取会话的置顶状态 同时设置 setConversationStatusListener 监听器,在onConversationTagChanged回调中更新会话置顶状态,保证会话置顶的准确性
此方法会从本地数据库中,读取该会话是否置顶。
- Parameters:
targetId- 会话 IDconversationType- 会话类型channelId- 消息所属会话的业务标识callback- 是否置顶的结果回调- Since:
5.1.5
-
getUnreadCount
abstract void getUnreadCount(String targetId, ConversationType conversationType, Array<String> objectNames, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话内指定消息类型的未读消息数(聊天室会话除外)
- Parameters:
targetId- 会话目标 IDconversationType- 会话类型objectNames- 消息类型数组channelId- 消息所属会话的业务标识callback- 未读数结果的回调- Since:
5.1.5
-
getPrivateMessageDeliverTime
abstract void getPrivateMessageDeliverTime(String uid, String channelId, IRongCoreCallback.ResultCallback<Long> callback)
获取单聊某条消息的送达时间
- Parameters:
uid- 消息 uid getUIdchannelId- 消息所属会话的业务标识。callback- 获取单聊某条消息的送达时间回调,回调返回参数为消息送达时间,时间单位为毫秒- Since:
SDK 5.1.7
-
getGroupMessageDeliverList
abstract void getGroupMessageDeliverList(String uid, String targetId, String channelId, IRongCoreListener.IGetGroupMessageDeliverListCallback callback)
获取群组消息送达列表(只支持群组)
只查询本地数据库中 UID 存在且发送方向为 SEND 对方已经接收的消息。
- Parameters:
uid- 消息 uid getUIdtargetId- 群组 idchannelId- 消息所属会话的业务标识。callback- 获取群组消息送达列表回调- Since:
SDK 5.1.7
-
getMessageByUid
abstract void getMessageByUid(String uid, IRongCoreCallback.ResultCallback<Message> callback)
通过全局唯一 id 获取消息实体。
- Parameters:
uid- 全局唯一 id(服务器消息唯一 id)。callback- 获取消息的回调。- Since:
5.1.7
-
getUltraGroupUnreadMentionedCount
abstract void getUltraGroupUnreadMentionedCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)
获取超级群会话中被 @ 的消息数
注意:此方法只支持超级群的会话类型!
- Parameters:
targetId- 会话 IDcallback- 超级群会话中被 @ 的消息数回调- Since:
SDK 5.1.8
-
sendUltraGroupTypingStatus
abstract void sendUltraGroupTypingStatus(String targetId, String channelId, IRongCoreEnum.UltraGroupTypingStatus typingStatus, IRongCoreCallback.OperationCallback callback)
发送超级群输入状态
- Parameters:
targetId- 会话 idchannelId- 消息所属会话的业务标识typingStatus- IRongCoreEnum.UltraGroupTypingStatuscallback- 发送超级群输入状态回调- Since:
5.2.0
-
deleteUltraGroupMessagesForAllChannel
abstract void deleteUltraGroupMessagesForAllChannel(String targetId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)
删除本地所有 channel 特定时间之前的消息
- Parameters:
targetId- 会话 idtimestamp- 时间戳callback- 删除本地所有 channel 特定时间之前的消息回调- Since:
5.2.0
-
deleteUltraGroupMessages
abstract void deleteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)
删除本地特定 channel 特点时间之前的消息
- Parameters:
targetId- 会话 idchannelId- 消息所属会话的业务标识timestamp- 时间戳callback- 删除本地所有 channel 特定时间之前的消息回调- Since:
5.2.0
-
deleteRemoteUltraGroupMessages
abstract void deleteRemoteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
删除服务端特定 channel 特定时间之前的消息
- Parameters:
targetId- 会话 idchannelId- 消息所属会话的业务标识itimestamp- 时间戳callback- 删除服务端特定 channel 特定时间之前的消息回调- Since:
5.2.0
-
modifyUltraGroupMessage
abstract void modifyUltraGroupMessage(String msgUid, MessageContent content, IRongCoreCallback.OperationCallback callback)
修改消息
注意:此方法只能修改相同频道的同类型消息,仅能修改自己发送的消息
- Parameters:
msgUid- 消息 UIDcontent- MessageContentcallback- 修改消息回调- Since:
5.2.0
-
syncUltraGroupReadStatus
abstract void syncUltraGroupReadStatus(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
上报超级群的已读时间
- Parameters:
targetId- 会话 IDchannelId- 消息所属会话的业务标识timestamp- 已读时间callback- 上报超级群的已读时间回调- Since:
5.2.0
-
setUltraGroupReadTimeListener
abstract void setUltraGroupReadTimeListener(IRongCoreListener.UltraGroupReadTimeListener listener)
设置超级群已读时间回调监听器
此方法只支持超级群的会话类型
- Parameters:
listener- 超级群已读时间回调监听器- Since:
5.2.0
-
setUltraGroupTypingStatusListener
abstract void setUltraGroupTypingStatusListener(IRongCoreListener.UltraGroupTypingStatusListener listener)
设置超级群输入状态监听器
- Parameters:
listener- 超级群输入状态监听器- Since:
5.2.0
-
setUltraGroupMessageChangeListener
abstract void setUltraGroupMessageChangeListener(IRongCoreListener.UltraGroupMessageChangeListener listener)
设置超级群消息变更监听器
- Parameters:
listener- 超级群消息变更监听器- Since:
5.2.0
-
updateUltraGroupMessageExpansion
abstract void updateUltraGroupMessageExpansion(Map<String, String> expansion, String messageUId, IRongCoreCallback.OperationCallback callback)
更新超级群消息扩展信息
每条消息携带扩展信息键值对最大值 300个,单次设置扩展信息键值对最大值 20个
- Parameters:
expansion- 要更新的消息扩展信息键值对,类型是 HashMap;Key 支持大小写英文字母、数字、部分特殊符号 + = - _ 的组合方式,不支持汉字。Value 可以输入空格。messageUId- 消息 messageUIdcallback- 更新扩展信息回调- Since:
5.2.0
-
removeUltraGroupMessageExpansion
abstract void removeUltraGroupMessageExpansion(String messageUId, List<String> keyArray, IRongCoreCallback.OperationCallback callback)
删除超级群消息扩展信息中特定的键值对
- Parameters:
messageUId- 消息 messageUIdkeyArray- 消息扩展信息中待删除的 key 的列表,类型是 ArrayListcallback- 删除消息扩展信息回调- Since:
5.2.0
-
recallUltraGroupMessage
abstract void recallUltraGroupMessage(Message message, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)
撤回超级群消息
- Parameters:
message- 被撤回的消息callback- onSuccess 里回调 RecallNotificationMessage,IMLib 已经被撤回的消息需用 替换, 用户需要在界面上对 RecallNotificationMessage 进行展示。- Since:
5.2.0
-
recallUltraGroupMessage
abstract void recallUltraGroupMessage(Message message, boolean isDelete, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)
撤回超级群消息
- Parameters:
message- 被撤回的消息isDelete- 是否删除本地消息callback- onSuccess 里回调 RecallNotificationMessage,IMLib 已经被撤回的消息需用 替换, 用户需要在界面上对 RecallNotificationMessage 进行展示。- Since:
5.2.2
-
getUltraGroupConversationListForAllChannel
abstract void getUltraGroupConversationListForAllChannel(IRongCoreCallback.ResultCallback<List<Conversation>> callback)
获取超级群当前用户本地会话列表,该方法返回的是以下类型的会话列表:私聊,群组,讨论组,系统会话。
此方法会从本地数据库中,读取会话列表。返回的会话列表排序规则为:按照时间从前往后排列,如果有置顶的会话,则置顶的会话会排列在前面。 如果您需要获取其它类型的会话列表,可以使用getConversationList} 。 需要在连接数据库打开回调
OnDatabaseOpened后调用,IRongCoreCallback.ConnectCallback 。- Parameters:
callback- 获取会话列表的回调。- Since:
5.2.0
-
getBatchRemoteUltraGroupMessages
abstract void getBatchRemoteUltraGroupMessages(List<Message> msgList, IRongCoreCallback.IGetBatchRemoteUltraGroupMessageCallback callback)
从服务获取批量消息
- Parameters:
msgList- 消息列表callback- 从服务获取批量消息回调- Since:
5.2.0
-
getConversationListForAllChannel
abstract void getConversationListForAllChannel(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<List<Conversation>> callback)
获取特定会话下所有频道的会话列表(只支持单群聊,超级群,不支持聊天室)
- Parameters:
conversationType- 会话类型targetId- 会话 Idcallback- 获取特定会话下所有频道的会话列表回调- Since:
5.2.0
-
setNotificationQuietHoursLevel
abstract void setNotificationQuietHoursLevel(String startTime, int spanMinutes, IRongCoreEnum.PushNotificationQuietHoursLevel level, IRongCoreCallback.OperationCallback callback)
设置消息通知免打扰时间。
- Parameters:
startTime- 起始时间 格式 HH:MM:SS。spanMinutes- 设置的免打扰结束时间距离起始时间的间隔分钟数。 0 <spanMinutes <1440。 比如,您设置的起始时间是 00:00, 01:00,则 <spanMinutes <为 60 分钟。设置为 1439 代表全天免打扰 (23 * 60 + 59 = 1439 )。callback- 消息通知免打扰时间回调。- Since:
5.2.2
-
removeNotificationQuietHours
abstract void removeNotificationQuietHours(IRongCoreCallback.OperationCallback callback)
移除消息通知免打扰时间。
- Parameters:
callback- 移除消息通知免打扰时间回调。- Since:
5.2.2
-
getNotificationQuietHoursLevel
abstract void getNotificationQuietHoursLevel(IRongCoreCallback.GetNotificationQuietHoursCallbackEx callback)
获取消息通知免打扰时间。
- Parameters:
callback- 消息通知免打扰时间回调。参考 IRongCoreCallback.GetNotificationQuietHoursCallback 。- Since:
5.2.2
-
setConversationChannelNotificationLevel
abstract void setConversationChannelNotificationLevel(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
设置会话消息提醒状态。取消设置,请调用此方法,level 传入 PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE
注意:不支持聊天室!
注意:超级群通过该接口对具体频道进行免打扰设置
- Parameters:
conversationType- 会话类型。不支持聊天室类型,因为聊天室默认就是不接受消息提醒的。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。channelId- 消息所属会话的业务标识。level- 会话设置的消息提醒级别。callback- 设置状态的回调。- Since:
5.2.2
-
setConversationsNotificationLevel
abstract void setConversationsNotificationLevel(List<ConversationIdentifier> conversationIdentifiers, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
异步批量设置会话的消息提醒状态
取消设置,请调用此方法,level 传入 * io.rong.imlib.IRongCoreEnum.PushNotificationLevel#PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE
注意:不支持聊天室!
注意:超级群通过该接口对具体频道进行免打扰设置
- Parameters:
conversationIdentifiers- 会话标识列表,最大数量为 20level- 会话设置的消息提醒级别。callback- 回调结果- Since:
5.6.7
-
getConversationChannelNotificationLevel
abstract void getConversationChannelNotificationLevel(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
获取会话消息提醒状态。
注意:不支持聊天室!
- Parameters:
conversationType- 会话类型,不支持聊天室(聊天室默认是不接受会话消息提醒的)。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。callback- 获取消息提醒状态的回调。- Since:
5.2.2
-
setConversationNotificationLevel
abstract void setConversationNotificationLevel(ConversationType conversationType, String targetId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
指定会话免打扰设置
注意:超级群调用该接口,相当于设置了 channelId 为 空 的频道的免打扰,不会屏蔽整个超级群会话下所有频道的免打扰
- Parameters:
conversationType- 会话类型。不支持聊天室类型,因为聊天室默认就是不接受消息提醒的。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。level- 会话设置的消息提醒级别。callback- 设置状态的回调。- Since:
5.2.2
-
getConversationNotificationLevel
abstract void getConversationNotificationLevel(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
获取指定会话免打扰状态。
注意:不支持聊天室!
- Parameters:
conversationType- 会话类型,不支持聊天室(聊天室默认是不接受会话消息提醒的)。targetId- 会话 id。根据不同的 conversationType,可能是用户 id、讨论组 id、群组 id。callback- 获取消息提醒状态的回调。- Since:
5.2.2
-
setConversationTypeNotificationLevel
abstract void setConversationTypeNotificationLevel(ConversationType conversationType, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
指定会话类型免打扰设置
按照特定会话类型进行免打扰设置 明确支持:单聊,群聊,超级群,系统会话
- Parameters:
conversationType- 会话类型。不支持聊天室类型,因为聊天室默认就是不接受消息提醒的。level- 会话设置的消息提醒级别。callback- 设置状态的回调。- Since:
5.2.2
-
getConversationTypeNotificationLevel
abstract void getConversationTypeNotificationLevel(ConversationType conversationType, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
获取指定会话类型免打扰状态。
注意:不支持聊天室!
- Parameters:
conversationType- 会话类型,不支持聊天室(聊天室默认是不接受会话消息提醒的)。callback- 获取消息提醒状态的回调。- Since:
5.2.2
-
getUltraGroupConversationDefaultNotificationLevel
abstract void getUltraGroupConversationDefaultNotificationLevel(String targetId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
查询指定超级群默认通知配置
- Parameters:
targetId- 会话 IDcallback- 查询指定超级群默认通知配置回调。- Since:
5.2.2
-
getUltraGroupConversationChannelDefaultNotificationLevel
abstract void getUltraGroupConversationChannelDefaultNotificationLevel(String targetId, String channelId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
查询指定超级群指定频道默认通知配置
- Parameters:
targetId- 会话 IDchannelId- 消息所属会话的业务标识。callback- 查询指定超级群指定频道默认通知配置回调。- Since:
5.2.2
-
setUltraGroupConversationDefaultNotificationLevel
abstract void setUltraGroupConversationDefaultNotificationLevel(String targetId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
- Since:
5.2.2
-
setUltraGroupConversationChannelDefaultNotificationLevel
abstract void setUltraGroupConversationChannelDefaultNotificationLevel(String targetId, String channelId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
- Since:
5.2.2
-
getUltraGroupUnreadCount
abstract void getUltraGroupUnreadCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定超级群下所有频道的未读消息总数
- Parameters:
targetId- 会话 IDcallback- 获取指定超级群下所有频道的未读消息总数接口回调。- Since:
5.2.2
-
getUltraGroupAllUnreadCount
abstract void getUltraGroupAllUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback)
获取超级群会话类型的所有未读消息数
- Parameters:
callback- 获取超级群会话类型的所有未读消息数回调。- Since:
5.2.2
-
getUltraGroupAllUnreadMentionedCount
abstract void getUltraGroupAllUnreadMentionedCount(IRongCoreCallback.ResultCallback<Integer> callback)
获取超级群会话类型的@消息未读数接口
- Parameters:
callback- 获取超级群会话类型的@消息未读数接口回调。- Since:
5.2.2
-
setUltraGroupConversationListener
abstract void setUltraGroupConversationListener(IRongCoreListener.UltraGroupConversationListener listener)
设置超级群会话监听器
- Since:
5.2.2
-
getConversationListWithAllChannel
abstract void getConversationListWithAllChannel(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)
-
getConversationListWithAllChannelByPage
abstract void getConversationListWithAllChannelByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes, long timeStamp, int count)
-
searchMessageForAllChannel
abstract void searchMessageForAllChannel(String targetId, ConversationType conversationType, String keyword, int count, long timestamp, IRongCoreCallback.ResultCallback<List<Message>> callback)
-
searchMessageByTimestampForAllChannel
abstract void searchMessageByTimestampForAllChannel(String targetId, ConversationType conversationType, String keyword, long startTime, long endTime, int offset, int limit, IRongCoreCallback.ResultCallback<List<Message>> callback)
-
searchConversationForAllChannel
abstract void searchConversationForAllChannel(String keyword, Array<ConversationType> conversationTypes, Array<String> objName, IRongCoreCallback.ResultCallback<List<SearchConversationResult>> callback)
-
getUltraGroupChannelList
abstract void getUltraGroupChannelList(String targetId, IRongCoreEnum.UltraGroupChannelType channelType, IRongCoreCallback.ResultCallback<List<Conversation>> callback)
获取超级群频道列表
- Parameters:
targetId- 超级群 idchannelType- 频道类型callback- 结果回调- Since:
5.2.4
-
setUltraGroupChannelListener
abstract void setUltraGroupChannelListener(IRongCoreListener.UltraGroupChannelListener listener)
超级群频道事件监听
- Since:
5.2.4
-
getUnreadCount
abstract void getUnreadCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取会话未读消息数
- Parameters:
conversationTypes- 会话类型列表:[单聊、群聊、超级群]levels- 免打扰类型列表 [PushNotificationLevel]callback- 获取会话未读消息数回调- Since:
5.2.5
-
getUnreadMentionedCount
abstract void getUnreadMentionedCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取获取会话未读
@消息数- Parameters:
conversationTypes- 会话类型列表:[群聊、超级群]levels- 免打扰类型列表 [PushNotificationLevel]callback- 获取获取会话未读@消息数 回调- Since:
5.2.5
-
getUltraGroupUnreadCount
abstract void getUltraGroupUnreadCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定超级群会话的未读消息数(包括所有频道)
- Parameters:
targetId- 超级群会话 IDlevels- 免打扰类型列表 [PushNotificationLevel]callback- 获取指定超级群会话的未读消息数(包括所有频道) 回调- Since:
5.2.5
-
getUltraGroupUnreadMentionedCount
abstract void getUltraGroupUnreadMentionedCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定超级群会话的未读
@消息数(包括所有频道)- Parameters:
targetId- 超级群会话 IDlevels- 免打扰类型列表 [PushNotificationLevel]callback- 获取指定超级群会话的未读@消息数(包括所有频道)回调- Since:
5.2.5
-
getUnreadMentionedMessages
abstract void getUnreadMentionedMessages(ConversationType conversationType, String targetId, String channelId, int count, boolean desc, IRongCoreCallback.ResultCallback<List<Message>> callback)
- Since:
5.2.5
-
getUltraGroupUnreadMentionedDigests
abstract void getUltraGroupUnreadMentionedDigests(String targetId, String channelId, long sendTime, int count, IRongCoreCallback.ResultCallback<List<MessageDigestInfo>> callback)
获取超级群会话类型未读的@消息摘要列表接口
- Parameters:
targetId- 超级群会话 IDchannelId- 消息所属会话的业务标识。sendTime- 消息发送的时间[0代表从第一条开始查询]count- 查询数量 [0 - 50],超过范围上报 INVALID_PARAMETER_COUNT 错误码callback- 获取超级群会话类型未读的@消息摘要列表接口回调- Since:
5.2.5
-
getBatchLocalMessages
abstract void getBatchLocalMessages(ConversationType conversationType, String targetId, String channelId, List<String> messageUIDs, IRongCoreCallback.IGetMessagesByUIDsCallback callback)
- Parameters:
conversationType- 会话类型,支持单聊、群聊、超级群、聊天室会话类型targetId- 会话 IDchannelId- 频道 ID,非超级群时传入 nullmessageUIDs- 要获取的消息 UID 列表,最多支持 20 条callback- 结果回调- Since:
5.2.5.2 批量获取本地消息
-
setUserGroupStatusListener
abstract void setUserGroupStatusListener(IRongCoreListener.UserGroupStatusListener userGroupStatusListener)
设置用户组状态监听器
- Since:
5.4.0
-
getUltraGroupConversationUnreadInfoList
abstract void getUltraGroupConversationUnreadInfoList(Array<String> targetIds, IRongCoreCallback.ResultCallback<List<ConversationUnreadInfo>> callback)
根据超级群的TargetId数组,获取每个超级群下所有频道的会话的未读相关信息
- Parameters:
targetIds- 超级群会话的TargetId数组,最多支持 20 个callback- 结果回调- Since:
5.4.6
-
getUltraGroupMessageCountByTimeRange
abstract void getUltraGroupMessageCountByTimeRange(String targetId, Array<String> channelIds, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)
获取某个超级群指定 channel 列表,某段时间范围内的消息数量,如果 channel_id_list 为空,则返回全部 channel id 的消息数量
- Parameters:
targetId- 会话 IDchannelIds- 频道 ID 列表startTime- 开始时间endTime- 结束时间callback- 回调结果- Since:
5.6.4
-
getMessageCountByTimeRange
abstract void getMessageCountByTimeRange(String targetId, ConversationType conversationType, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)
获取某个会话某段时间范围内的消息数量,如果为超级群则需获取所有 channel id 的消息数量
- Parameters:
targetId- 会话 IDconversationType- 会话类型,支持单聊、群聊、超级群、聊天室会话类型startTime- 开始时间endTime- 结束时间callback- 回调结果- Since:
5.6.4
-
sendReadReceiptMessageV4
abstract void sendReadReceiptMessageV4(ConversationType conversationType, String targetId, String channelId, String startMessageUID, String endMessageUID, IRongCoreCallback.OperationCallback callback)
发送已读回执v4(支持单群聊)
- Parameters:
conversationType- 会话类型targetId- 会话 idchannelId- 频道 ID,非超级群时传入 nullstartMessageUID- 群聊已读开始的消息UID,单聊为""endMessageUID- 已读最后一条消息的UIDcallback- 回调函数- Since:
5.6.7
-
getMessageReadReceiptV4
abstract void getMessageReadReceiptV4(String targetId, String channelId, String messageUID, IRongCoreCallback.ResultCallbackEx<Integer, Integer, List<GroupMessageReader>> callback)
获取消息已读用户列表(支持群组)
- Parameters:
targetId- 会话 idchannelId- 频道 ID,非超级群时传入 nullmessageUID- 会话中需要发送已读回执的消息callback- 回调函数- Since:
5.6.7
-
-
-
-