BytedIM

类型: class

IM 类,所有 API 交互都通过该类的实例来操作,实例化支持的参数参见 IMOption。

init()

初始化 SDK。
初始化时会完成与服务端的消息游标同步和历史信息同步。

getMessagesByUser()

拉取用户混链消息。
通常无需业务调用,SDK 内部会轮询。

createCustomMessage()

创建自定义消息。

createTextMessage()

创建文本消息。

sendMessage()

发送消息。

deleteMessage()

删除消息。

recallMessage()

删除消息。

getMessageByServerId()

获取消息的实时信息。

getMessageReferenceList()

获取引用消息链。
若消息 B 引用了消息 A,消息 C 引用了消息 B,那么 A -> B -> C 就是一条引用消息链。通过 A、B、C 任意一条消息都可以获取这条消息链。

modifyMessageProperty()

设置消息属性。
常见使用场景:给某条消息点赞、加急等。

getConversation()

获取指定单个本地会话。

getConversationOnline()

请求服务端更新本地会话后,获取指定单个会话。

getConversationList()

获取本地会话列表。

getConversationListOnline()

请求服务端更新本地会话后,获取会话列表。

getMessagesByConversation()

请求服务器获取会话内的消息列表。

getUserConversationList()

请求服务器获取用户的会话列表。

createConversation()

创建群聊。

leaveConversation()

离开群组。

deleteConversation()

删除会话。

dissolveConversation()

解散群聊。

setConversationSettingInfo()

设置会话附加信息,如置顶、免打扰、收藏等。

setConversationWeakMuteConfig()

配置会话低打扰模式。

upsertConversationSettingExtInfo()

更新 Setting ext 拓展信息。

setConversationCoreInfo()

设置群聊信息。

upsertConversationCoreExtInfo()

更新 Core ext 拓展信息。

getConversationListByTop()

获取顶置会话。

getConversationListByFavorite()

获取收藏会话。

markConversationRead()

标记会话已读。

addParticipants()

添加群成员。

removeParticipants()

移除群成员/离开直播群/移除直播群成员,v1.1.0 新增直播群功能。

updateParticipant()

更新群成员信息。

getParticipants()

获取 SDK 本地维护的群成员列表。

getParticipantsOnline()

获取群成员列表。
此方法会在 SDK 内部循环调用分页接口,直至没有更多数据,然后把所有群成员数据一次返回。当群成员较多时,此方法耗时较久。

setConversationMute()

设置群禁言(会话维度)。

setParticipantMuteTime()

设置群禁言(成员维度)。

dispose()

手动卸载 SDK。

LivePlugin

类型: class

直播群插件,在 IM 实例化时传入后,IM 实例增加直播群相关的方法。v1.1.0 新增。

new LivePlugin()
joinLiveGroup()

加入直播群,加入成功时会启动直播 ping 和断线恢复重进(接口基于 addParticipants)

leaveLiveGroup()

离开直播群,并且会停止直播 ping(接口基于 removeParticipants)

setParticipantBlockTime()

拉黑直播群成员。

getMuteParticipantsOnline()

获取直播群禁言成员列表。

getBlockParticipantsOnline()

获取直播群被拉黑成员列表。

getLiveParticipantMuteWhiteListOnline()

获取直播群禁言白名单

addLiveParticipantMuteWhiteList()

添加指定成员到直播群禁言白名单

removeLiveParticipantMuteWhiteList()

从直播群禁言白名单移除指定成员

getLiveConversationListOnline()

获取直播群列表。

getLiveParticipantsOnline()

获取直播群在线成员列表。

getLiveParticipantCountOnline()

获取直播群在线人数

getLiveParticipantInfoOnline()

获取直播群指定成员信息(例如是否在线),v1.1.2 新增。

MultimediaPlugin

类型: class

多媒体消息插件,在 IM 实例化时传入后,IM 实例增加发送媒体消息的方法。

new BaseMultimediaPlugin()
createImageMessage()

创建图片消息。

createAudioMessage()

创建音频消息。

createVideoMessage()

创建视频消息。

createFileMessage()

创建文件消息。

refreshFileUrl()

根据消息内容刷新文件 URL。

validateFileUrl()

校验文件 url 是否在有效期

getImageResizeUrls()

获取图片 URL(缩放、转码)。

EventBus

类型: class

subscribe()

创建一个事件订阅

unsubscribe()

取消一个事件订阅