ChannelClient

public abstract class ChannelClient

Constructors

Link copied to clipboard
public void ChannelClient()

Functions

Link copied to clipboard
public abstract void cleanHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, boolean cleanRemote, IRongCoreCallback.OperationCallback callback)
删除指定时间戳之前的消息,可选择是否同时删除服务器端消息 此方法可从服务器端清除历史消息,但是必须先开通历史消息云存储功能。 根据会话类型和会话 id 清除某一会话指定时间戳之前的本地数据库消息(服务端历史消息), 清除成功后只能从本地数据库(服务端)获取到该时间戳之后的历史消息。
Link copied to clipboard
public abstract void cleanRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long recordTime, IRongCoreCallback.OperationCallback callback)
清除服务器上存储的历史消息。 根据会话类型和目标会话 id 清除某一会话指定时间戳之前的服务端历史消息, 清除成功后只能从服务端获取到该时间戳之后的历史消息。 注意:必须先开通历史消息云存储功能!
Link copied to clipboard
public abstract void clearConversations(IRongCoreCallback.ResultCallback<Boolean> callback, String channelId, Array<ConversationType> conversationTypes)
清空指定会话类型列表中的所有会话及会话信息。(不支持超级群)
Link copied to clipboard
public abstract void clearMessages(List<ClearMessageOption> clearMessageOptions, IRongCoreCallback.ResultCallback<Boolean> callback)
异步批量删除指定会话早于(含)发送时间的所有本地数据库消息。 此方法删除数据库中会话早于(含)发送时间的消息记录, 时间戳传 0 清除所有消息 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
public abstract void clearMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
删除某个会话中的所有消息。 注意:不支持聊天室!
Link copied to clipboard
public abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
public abstract void clearMessagesUnreadStatus(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
清除某个会话中的未读消息数。 注意:不支持聊天室,不支持超级群
Link copied to clipboard
public abstract void clearRemoteMessages(List<ClearMessageOption> clearMessageOptions, boolean isDeleteLocal, IRongCoreCallback.OperationCallback callback)
异步批量删除服务端指定会话早于(含)发送时间的所有远端消息(可以删除对应的本地消息) 时间戳传 0 清除所有消息 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
Link copied to clipboard
public abstract void clearTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
删除指定会话中的草稿信息。
Link copied to clipboard
public abstract void deleteMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
删除某个会话中的所有消息。 此接口删除指定会话中数据库的所有消息,同时会清理数据库空间,减少占用空间。
Link copied to clipboard
public abstract void deleteRemoteMessages(ConversationType conversationType, String targetId, String channelId, Array<Message> messages, IRongCoreCallback.OperationCallback callback)
批量删除某个会话中的指定远端消息(同时删除对应的本地消息)。 一次批量操作仅支持删除属于同一个会话的消息,请确保消息列表中的所有消息来自同一会话,一次最多删除 100 条消息。 注意:不支持聊天室! 5.6.9版本以下不支持超级群会话类型,从 5.6.
Link copied to clipboard
public abstract void deleteRemoteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
删除服务端特定 channel 特定时间之前的消息
Link copied to clipboard
public abstract void deleteUltraGroupMessages(String targetId, String channelId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)
删除本地特定 channel 特点时间之前的消息
Link copied to clipboard
public abstract void deleteUltraGroupMessagesForAllChannel(String targetId, long timestamp, IRongCoreCallback.ResultCallback<Boolean> callback)
删除本地所有 channel 特定时间之前的消息
Link copied to clipboard
public abstract void downloadMedia(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.MediaType mediaType, String imageUrl, IRongCoreCallback.DownloadMediaCallback callback)
下载多媒体文件。 如果本地缓存中包含此文件,则从本地缓存中直接获取,否则将从服务器端下载。
Link copied to clipboard
public abstract void getBatchLocalMessages(ConversationType conversationType, String targetId, String channelId, List<String> messageUIDs, IRongCoreCallback.IGetMessagesByUIDsCallback callback)
Link copied to clipboard
从服务获取批量消息
Link copied to clipboard
public abstract void getBlockedConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)
获取免打扰的会话列表。
Link copied to clipboard
public abstract void getConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Conversation> callback)
获取单个会话信息。
Link copied to clipboard
public abstract void getConversationChannelNotificationLevel(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
获取会话消息提醒状态。 注意:不支持聊天室!
Link copied to clipboard
public abstract void getConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId)
获取当前用户本地会话列表,该方法返回的是以下类型的会话列表:私聊,群组,讨论组,系统会话。 此方法会从本地数据库中,读取会话列表。返回的会话列表排序规则为:按照时间从前往后排列,如果有置顶的会话,则置顶的会话会排列在前面。 如果您需要获取其它类型的会话列表,可以使用getConversationList} 。 需要在连接数据库打开回调 OnDatabaseOpened 后调用,IRongCoreCallback.ConnectCallback
public abstract void getConversationList(String channelId, IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)
根据会话类型,获取当前用户的本地会话列表。
Link copied to clipboard
public abstract void getConversationListByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, long timeStamp, int count, String channelId, Array<ConversationType> conversationTypes)
public abstract void getConversationListByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, long timeStamp, int count, String channelId, boolean topPriority, Array<ConversationType> conversationTypes)
分页获取会话列表。
Link copied to clipboard
public abstract void getConversationListForAllChannel(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<List<Conversation>> callback)
获取特定会话下所有频道的会话列表(只支持单群聊,超级群,不支持聊天室)
Link copied to clipboard
public abstract void getConversationListWithAllChannel(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)
Link copied to clipboard
public abstract void getConversationListWithAllChannelByPage(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes, long timeStamp, int count)
Link copied to clipboard
public abstract void getConversationNotificationLevel(ConversationType conversationType, String targetId, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
获取指定会话免打扰状态。 注意:不支持聊天室!
Link copied to clipboard
public abstract void getConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)
获取会话消息提醒状态。 注意:不支持聊天室!
Link copied to clipboard
public abstract void getConversationTopStatus(String targetId, ConversationType conversationType, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
获取会话的置顶状态 同时设置 setConversationStatusListener 监听器,在onConversationTagChanged回调中更新会话置顶状态,保证会话置顶的准确性 此方法会从本地数据库中,读取该会话是否置顶。
Link copied to clipboard
public abstract void getConversationTypeNotificationLevel(ConversationType conversationType, IRongCoreCallback.ResultCallback<IRongCoreEnum.PushNotificationLevel> callback)
获取指定会话类型免打扰状态。 注意:不支持聊天室!
Link copied to clipboard
public abstract void getGroupMessageDeliverList(String uid, String targetId, String channelId, IRongCoreListener.IGetGroupMessageDeliverListCallback callback)
获取群组消息送达列表(只支持群组) 只查询本地数据库中 UID 存在且发送方向为 SEND 对方已经接收的消息。
Link copied to clipboard
public abstract void getHistoryMessages(ConversationType conversationType, String targetId, int oldestMessageId, int count, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取会话中,从指定消息之前、指定数量的、指定消息类型的最新消息实体。 注意:不支持聊天室! 该方法仅获取本地数据库中的消息。 注意:since 5.4.
public 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.
public 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.
public 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.
public 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.
Link copied to clipboard
public static ChannelClient getInstance()
Link copied to clipboard
public abstract void getLatestMessages(ConversationType conversationType, String targetId, String channelId, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取指定会话的最新消息。
Link copied to clipboard
public abstract void getMessageByUid(String uid, IRongCoreCallback.ResultCallback<Message> callback)
通过全局唯一 id 获取消息实体。
Link copied to clipboard
public abstract void getMessageCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话的消息总数。
Link copied to clipboard
public abstract void getMessageCountByTimeRange(String targetId, ConversationType conversationType, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)
获取某个会话某段时间范围内的消息数量,如果为超级群则需获取所有 channel id 的消息数量
Link copied to clipboard
public abstract void getMessageReadReceiptV4(String targetId, String channelId, String messageUID, IRongCoreCallback.ResultCallbackEx<Integer, Integer, List<GroupMessageReader>> callback)
获取消息已读用户列表(支持群组)
Link copied to clipboard
public abstract void getMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallback callback)
public abstract void getMessages(ConversationType conversationType, String targetId, String channelId, HistoryMessageOption historyMessageOption, IRongCoreCallback.IGetMessageCallbackEx getMessageCallback)
获取指定会话历史消息。 此方法先从本地获取历史消息,本地有缺失的情况下会从服务端同步缺失的部分;从服务端同步失败的时候会返回非 0 的 errorCode,同时把本地能取到的消息回调上去。 必须开通历史消息云存储功能。
Link copied to clipboard
获取消息通知免打扰时间。
Link copied to clipboard
public abstract void getPrivateMessageDeliverTime(String uid, String channelId, IRongCoreCallback.ResultCallback<Long> callback)
获取单聊某条消息的送达时间
Link copied to clipboard
public abstract void getRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, RemoteHistoryMsgOption remoteHistoryMsgOption, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取指定会话远端历史消息。(不支持超级群) 此功能需要在融云开发者后台开启历史消息云存储功能。注意:不支持聊天室!
public abstract void getRemoteHistoryMessages(ConversationType conversationType, String targetId, String channelId, long dateTime, int count, IRongCoreCallback.ResultCallback<List<Message>> callback)
从服务器端获取指定时间之前的历史消息。(不支持超级群) 区别于 getHistoryMessages,该接口是从融云服务器中拉取。从服务端拉取消息后,客户端会做排重,返回排重后的数据。通常用于更换新设备后,拉取历史消息。 使用的时候,建议优先通过 getHistoryMessages 从本地数据库拉取历史消息, 当本地数据库没有历史消息后,再通过此接口获取服务器历史消息,时间戳传入本地数据库里最早的消息时间戳。注意: 1.
Link copied to clipboard
public abstract void getTextMessageDraft(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<String> callback)
获取会话中的草稿信息。
Link copied to clipboard
public abstract void getTheFirstUnreadMessage(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Message> callback)
获取第一条未读消息。
Link copied to clipboard
public abstract void getTopConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, String channelId, Array<ConversationType> conversationTypes)
根据会话类型,获取置顶会话列表
Link copied to clipboard
public abstract void getTotalUnreadCount(String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取所有会话的总未读消息数。 注意:不包含聊天室,聊天室消息不计数。
public abstract void getTotalUnreadCount(String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)
Link copied to clipboard
public abstract Collection<TypingStatus> getTypingUserListFromConversation(ConversationType conversationType, String targetId, String channelId)
获取会话正在输入的用户列表
Link copied to clipboard
public abstract void getUltraGroupAllUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback)
获取超级群会话类型的所有未读消息数
Link copied to clipboard
获取超级群会话类型的@消息未读数接口
Link copied to clipboard
public abstract void getUltraGroupChannelList(String targetId, IRongCoreEnum.UltraGroupChannelType channelType, IRongCoreCallback.ResultCallback<List<Conversation>> callback)
获取超级群频道列表
查询指定超级群指定频道默认通知配置
查询指定超级群默认通知配置
public abstract void getUltraGroupConversationListForAllChannel(IRongCoreCallback.ResultCallback<List<Conversation>> callback)
获取超级群当前用户本地会话列表,该方法返回的是以下类型的会话列表:私聊,群组,讨论组,系统会话。 此方法会从本地数据库中,读取会话列表。返回的会话列表排序规则为:按照时间从前往后排列,如果有置顶的会话,则置顶的会话会排列在前面。 如果您需要获取其它类型的会话列表,可以使用getConversationList} 。 需要在连接数据库打开回调 OnDatabaseOpened 后调用,IRongCoreCallback.ConnectCallback
Link copied to clipboard
public abstract void getUltraGroupConversationUnreadInfoList(Array<String> targetIds, IRongCoreCallback.ResultCallback<List<ConversationUnreadInfo>> callback)
根据超级群的TargetId数组,获取每个超级群下所有频道的会话的未读相关信息
Link copied to clipboard
public abstract void getUltraGroupMessageCountByTimeRange(String targetId, Array<String> channelIds, long startTime, long endTime, IRongCoreCallback.ResultCallback<Integer> callback)
获取某个超级群指定 channel 列表,某段时间范围内的消息数量,如果 channel_id_list 为空,则返回全部 channel id 的消息数量
Link copied to clipboard
public abstract void getUltraGroupUnreadCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定超级群下所有频道的未读消息总数
public abstract void getUltraGroupUnreadCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定超级群会话的未读消息数(包括所有频道)
Link copied to clipboard
public abstract void getUltraGroupUnreadMentionedCount(String targetId, IRongCoreCallback.ResultCallback<Integer> callback)
获取超级群会话中被 @ 的消息数 注意:此方法只支持超级群的会话类型!
public abstract void getUltraGroupUnreadMentionedCount(String targetId, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定超级群会话的未读@ 消息数(包括所有频道)
Link copied to clipboard
public abstract void getUltraGroupUnreadMentionedDigests(String targetId, String channelId, long sendTime, int count, IRongCoreCallback.ResultCallback<List<MessageDigestInfo>> callback)
获取超级群会话类型未读的@消息摘要列表接口
Link copied to clipboard
public abstract void getUnreadConversationList(IRongCoreCallback.ResultCallback<List<Conversation>> callback, Array<ConversationType> conversationTypes)
根据会话类型,获取当前用户未读的本地会话列表。
Link copied to clipboard
public abstract void getUnreadCount(IRongCoreCallback.ResultCallback<Integer> callback, String channelId, Array<ConversationType> conversationTypes)
public abstract void getUnreadCount(Array<ConversationType> conversationTypes, String channelId, boolean containBlocked, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话类型的总未读消息数。 注意:不包含聊天室,聊天室消息不计数。
public abstract void getUnreadCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取会话未读消息数
public abstract void getUnreadCount(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话的未读消息数。 注意:不包含聊天室,聊天室消息不计数。
public abstract void getUnreadCount(String targetId, ConversationType conversationType, Array<String> objectNames, String channelId, IRongCoreCallback.ResultCallback<Integer> callback)
获取指定会话内指定消息类型的未读消息数(聊天室会话除外)
Link copied to clipboard
public abstract void getUnreadMentionedCount(List<ConversationType> conversationTypes, List<IRongCoreEnum.PushNotificationLevel> levels, IRongCoreCallback.ResultCallback<Integer> callback)
获取获取会话未读 @ 消息数
Link copied to clipboard
public abstract void getUnreadMentionedMessages(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<List<Message>> callback)
获取会话中未读的 @ 消息。
public abstract void getUnreadMentionedMessages(ConversationType conversationType, String targetId, String channelId, int count, boolean desc, IRongCoreCallback.ResultCallback<List<Message>> callback)
Link copied to clipboard
public 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
Link copied to clipboard
public 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
public abstract void insertOutgoingMessage(ConversationType type, String targetId, String channelId, boolean canIncludeExpansion, SentStatus sentStatus, MessageContent content, long sentTime, IRongCoreCallback.ResultCallback<Message> resultCallback)
Link copied to clipboard
public abstract void modifyUltraGroupMessage(String msgUid, MessageContent content, IRongCoreCallback.OperationCallback callback)
修改消息 注意:此方法只能修改相同频道的同类型消息,仅能修改自己发送的消息
Link copied to clipboard
public abstract void recallUltraGroupMessage(Message message, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)
public abstract void recallUltraGroupMessage(Message message, boolean isDelete, IRongCoreCallback.ResultCallback<RecallNotificationMessage> callback)
撤回超级群消息
Link copied to clipboard
public abstract void removeConversation(ConversationType conversationType, String targetId, String channelId, IRongCoreCallback.ResultCallback<Boolean> callback)
从会话列表中移除某一会话。 此方法不删除会话内的消息。如果此会话中有新的消息,该会话将重新在会话列表中显示,并显示最近的历史消息。
Link copied to clipboard
public abstract void removeConversations(List<ConversationIdentifier> conversationIdentifiers, IRongCoreCallback.ResultCallback<Boolean> callback)
批量从会话列表中移除某一会话。 此方法不删除会话内的消息。如果此会话中有新的消息,该会话将重新在会话列表中显示,并显示最近的历史消息。 支持的会话类型:单聊, 群聊, 系统消息
Link copied to clipboard
移除消息通知免打扰时间。
Link copied to clipboard
public abstract void removeUltraGroupMessageExpansion(String messageUId, List<String> keyArray, IRongCoreCallback.OperationCallback callback)
删除超级群消息扩展信息中特定的键值对
Link copied to clipboard
public abstract void saveTextMessageDraft(ConversationType conversationType, String targetId, String channelId, String content, IRongCoreCallback.ResultCallback<Boolean> callback)
保存会话草稿信息。
Link copied to clipboard
public abstract void searchConversationForAllChannel(String keyword, Array<ConversationType> conversationTypes, Array<String> objName, IRongCoreCallback.ResultCallback<List<SearchConversationResult>> callback)
Link copied to clipboard
public abstract void searchConversations(String keyword, Array<ConversationType> conversationTypes, String channelId, Array<String> objectNames, IRongCoreCallback.ResultCallback<List<SearchConversationResult>> resultCallback)
根据关键字搜索会话。 此方法可快速返回匹配的会话列表,并且会话中包含已匹配的消息数量。通过 {SearchConversationResult#getMatchCount()} 得到。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
Link copied to clipboard
public abstract void searchMessageByTimestampForAllChannel(String targetId, ConversationType conversationType, String keyword, long startTime, long endTime, int offset, int limit, IRongCoreCallback.ResultCallback<List<Message>> callback)
Link copied to clipboard
public abstract void searchMessageForAllChannel(String targetId, ConversationType conversationType, String keyword, int count, long timestamp, IRongCoreCallback.ResultCallback<List<Message>> callback)
Link copied to clipboard
public abstract void searchMessages(ConversationIdentifier conversationIdentifier, String keyword, Array<String> objectNameList, int limit, long startTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据关键字搜索指定会话中,指定消息类型的本地历史消息 此方法允许应用根据关键词、对象名列表、时间范围等条件在一个特定对话中搜索消息。搜索结果将通过回调方式返回。
public abstract void searchMessages(ConversationType conversationType, String targetId, String channelId, String keyword, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据关键字搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。
public 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 方法。超级群会话类型只支持搜索已存储到本地的消息。
Link copied to clipboard
public abstract void searchMessagesByUser(ConversationType conversationType, String targetId, String channelId, String userId, int count, long beginTime, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据用户 id 搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。超级群会话类型只支持搜索已存储到本地的消息。
Link copied to clipboard
public abstract void searchMessagesByUserForAllChannel(ConversationType conversationType, String targetId, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据会话id、用户id等搜索指定会话中的消息。(包含所有的 ChannelId) 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
Link copied to clipboard
public abstract void searchMessagesByUserForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String userId, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据会话id、会话业务标识、用户ID等搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
Link copied to clipboard
public abstract void searchMessagesForChannels(ConversationType conversationType, String targetId, Array<String> channelIds, String keyword, long startTime, int limit, IRongCoreCallback.ResultCallback<List<Message>> resultCallback)
根据用户id、会话业务标识、关键字等搜索指定会话中的消息。 注意:如果需要自定义消息也能被搜索到,需要在自定义消息中实现 getSearchableWord 方法。
Link copied to clipboard
public abstract void sendDirectionalMediaMessage(Message message, Array<String> userIds, String pushContent, String pushData, IRongCoreCallback.ISendMediaMessageCallback callback)
发送定向多媒体消息。 向会话中特定的某些用户发送消息,会话中其他用户不会收到消息。 发送前构造 Message 消息实体,消息实体中的 content 必须为多媒体消息。 例如:ImageMessage 、 或其他继承自 MediaMessageContent 的消息。 从 5.6.
Link copied to clipboard
public abstract void sendDirectionalMessage(Message message, Array<String> userIds, String pushContent, String pushData, SendMessageOption option, IRongCoreCallback.ISendMessageCallback callback)
public 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.
Link copied to clipboard
public abstract void sendImageMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.SendImageMessageCallback callback)
发送图片消息。 如果您使用IMLib,可以使用此方法发送图片消息; 如果您使用 IMKit,请使用 RongIM 中的同名方法发送图片消息,否则不会自动更新 UI。
Link copied to clipboard
public abstract void sendMessage(ConversationType type, String targetId, String channelId, MessageContent content, String pushContent, String pushData, IRongCoreCallback.ISendMessageCallback callback)
根据会话类型,发送消息。 通过 io.rong.imlib.IRongCoreCallback.
Link copied to clipboard
public abstract void sendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp)
发送某个会话中的消息阅读回执 使用 IMLib 可以注册监听 setReadReceiptListener;使用 IMkit 直接设置 rc_config.
public abstract void sendReadReceiptMessage(ConversationType conversationType, String targetId, String channelId, long timestamp, IRongCoreCallback.ISendMessageCallback callback)
发送某个会话中的消息阅读回执。 使用 IMLib 可以注册监听 setReadReceiptListener;使用 IMkit 直接设置 rc_config.
Link copied to clipboard
public abstract void sendReadReceiptMessageV4(ConversationType conversationType, String targetId, String channelId, String startMessageUID, String endMessageUID, IRongCoreCallback.OperationCallback callback)
发送已读回执v4(支持单群聊)
Link copied to clipboard
public abstract void sendReadReceiptResponse(ConversationType type, String targetId, String channelId, List<Message> messageList, IRongCoreCallback.OperationCallback callback)
发送已读回执(只支持群组和讨论组)。
Link copied to clipboard
public abstract void sendTypingStatus(ConversationType conversationType, String targetId, String channelId, String typingContentType)
向会话中发送正在输入的状态,目前只支持单聊。
Link copied to clipboard
public abstract void sendUltraGroupTypingStatus(String targetId, String channelId, IRongCoreEnum.UltraGroupTypingStatus typingStatus, IRongCoreCallback.OperationCallback callback)
发送超级群输入状态
Link copied to clipboard
public abstract void setConversationChannelNotificationLevel(ConversationType conversationType, String targetId, String channelId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
设置会话消息提醒状态。取消设置,请调用此方法,level 传入 PUSH_NOTIFICATION_LEVEL_ALL_MESSAGE注意:不支持聊天室!注意:超级群通过该接口对具体频道进行免打扰设置
设置输入状态监听器。 当输入状态发生变化时,回调 onTypingStatusChanged (Conversation.
Link copied to clipboard
public abstract void setConversationNotificationLevel(ConversationType conversationType, String targetId, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
指定会话免打扰设置 注意:超级群调用该接口,相当于设置了 channelId 为 空 的频道的免打扰,不会屏蔽整个超级群会话下所有频道的免打扰
Link copied to clipboard
public abstract void setConversationNotificationStatus(ConversationType conversationType, String targetId, String channelId, ConversationNotificationStatus notificationStatus, IRongCoreCallback.ResultCallback<ConversationNotificationStatus> callback)
设置会话消息提醒状态。 注意:不支持聊天室!
Link copied to clipboard
public abstract void setConversationsNotificationLevel(List<ConversationIdentifier> conversationIdentifiers, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
异步批量设置会话的消息提醒状态 取消设置,请调用此方法,level 传入 * io.rong.imlib.IRongCoreEnum.
Link copied to clipboard
public abstract void setConversationsToTop(List<ConversationIdentifier> conversationIdentifiers, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)
异步批量设置会话的置顶状态
Link copied to clipboard
public abstract void setConversationToTop(ConversationType conversationType, String targetId, String channelId, boolean isTop, IRongCoreCallback.ResultCallback<Boolean> callback)
@Deprecated()
public abstract void setConversationToTop(ConversationType conversationType, String targetId, String channelId, boolean isTop, boolean needCreate, IRongCoreCallback.ResultCallback<Boolean> callback)
设置会话的置顶状态。 若会话不存在,调用此方法 SDK 自动创建会话并置顶。
Link copied to clipboard
public abstract void setConversationTypeNotificationLevel(ConversationType conversationType, IRongCoreEnum.PushNotificationLevel level, IRongCoreCallback.OperationCallback callback)
指定会话类型免打扰设置 按照特定会话类型进行免打扰设置 明确支持:单聊,群聊,超级群,系统会话
Link copied to clipboard
public abstract void setNotificationQuietHoursLevel(String startTime, int spanMinutes, IRongCoreEnum.PushNotificationQuietHoursLevel level, IRongCoreCallback.OperationCallback callback)
设置消息通知免打扰时间。
Link copied to clipboard
Link copied to clipboard
超级群频道事件监听
Link copied to clipboard
设置超级群会话监听器
Link copied to clipboard
设置超级群消息变更监听器
Link copied to clipboard
设置超级群已读时间回调监听器 此方法只支持超级群的会话类型
Link copied to clipboard
设置超级群输入状态监听器
Link copied to clipboard
public abstract void setUserGroupStatusListener(IRongCoreListener.UserGroupStatusListener userGroupStatusListener)
设置用户组状态监听器
Link copied to clipboard
public abstract void syncConversationReadStatus(ConversationType type, String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
同步会话阅读状态。
Link copied to clipboard
public abstract void syncUltraGroupReadStatus(String targetId, String channelId, long timestamp, IRongCoreCallback.OperationCallback callback)
上报超级群的已读时间
Link copied to clipboard
public abstract void updateConversationInfo(ConversationType conversationType, String targetId, String channelId, String title, String portrait, IRongCoreCallback.ResultCallback<Boolean> callback)
更新会话信息。
Link copied to clipboard
public abstract void updateUltraGroupMessageExpansion(Map<String, String> expansion, String messageUId, IRongCoreCallback.OperationCallback callback)
更新超级群消息扩展信息 每条消息携带扩展信息键值对最大值 300个,单次设置扩展信息键值对最大值 20个