BIMConnectListener
public interface com.bytedance.im.core.api.interfaces.BIMConnectListener
java

长链状态监听方。

成员函数
返回名称
voidonConnectStatusChanged
voidonTokenInvalid
函数说明

onConnectStatusChanged
void com.bytedance.im.core.api.interfaces.BIMConnectListener.onConnectStatusChanged(
    BIMConnectStatus status)
java

长链状态改变回调。

传入参数

参数名类型说明
statusBIMConnectStatus长链状态码, 参看 BIMConnectStatus。

onTokenInvalid
void com.bytedance.im.core.api.interfaces.BIMConnectListener.onTokenInvalid(
    BIMErrorCode code)
java

Token 失效回调。

传入参数

参数名类型说明
codeBIMErrorCodeToken 过期错误码, 参看 BIMErrorCode。
BIMConversationListListener
public interface com.bytedance.im.core.api.interfaces.BIMConversationListListener
java

会话监听方。

成员函数
返回名称
voidonNewConversation
voidonConversationChanged
voidonConversationDelete
voidonTotalUnreadMessageCountChanged
函数说明

onNewConversation
void com.bytedance.im.core.api.interfaces.BIMConversationListListener.onNewConversation(
    List<BIMConversation> conversationList)
java

获取到新的会话。

传入参数

参数名类型说明
conversationListList会话列表,参看 BIMConversation。

onConversationChanged
void com.bytedance.im.core.api.interfaces.BIMConversationListListener.onConversationChanged(
    List<BIMConversation> conversationList)
java

会话发生更新。

传入参数

参数名类型说明
conversationListList会话列表,参看 BIMConversation。

onConversationDelete
void com.bytedance.im.core.api.interfaces.BIMConversationListListener.onConversationDelete(
    List<BIMConversation> conversationList)
java

会话被删除。

传入参数

参数名类型说明
conversationListList会话列表,参看 BIMConversation。

onTotalUnreadMessageCountChanged
void com.bytedance.im.core.api.interfaces.BIMConversationListListener.onTotalUnreadMessageCountChanged(
    int totalUnreadCount)
java

会话未读消息数发生变化。

传入参数

参数名类型说明
totalUnreadCountint会话未读消息数。

注意
会话未读消息不包括设置为免打扰会话中的未读消息。

BIMLogListener
public interface com.bytedance.im.core.api.interfaces.BIMLogListener
java

日志监听方。

成员函数
返回名称
voidonLog
函数说明

onLog
void com.bytedance.im.core.api.interfaces.BIMLogListener.onLog(
    BIMLogLevel logLevel,
    String content)
java

主线程日志回调。

传入参数

参数名类型说明
logLevelBIMLogLevel日志级别。
contentString日志内容。
BIMMessageListener
public interface com.bytedance.im.core.api.interfaces.BIMMessageListener
java

消息监听方。

成员函数
返回名称
voidonReceiveMessage
voidonSendMessage
voidonDeleteMessage
voidonRecallMessage
voidonUpdateMessage
函数说明

onReceiveMessage
void com.bytedance.im.core.api.interfaces.BIMMessageListener.onReceiveMessage(
    BIMMessage message)
java

收到新消息。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。

onSendMessage
void com.bytedance.im.core.api.interfaces.BIMMessageListener.onSendMessage(
    BIMMessage message)
java

发送消息入库完成。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。

onDeleteMessage
void com.bytedance.im.core.api.interfaces.BIMMessageListener.onDeleteMessage(
    BIMMessage message)
java

收到的消息被删除。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。

onRecallMessage
void com.bytedance.im.core.api.interfaces.BIMMessageListener.onRecallMessage(
    BIMMessage message)
java

收到的消息被撤回。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。

onUpdateMessage
void com.bytedance.im.core.api.interfaces.BIMMessageListener.onUpdateMessage(
    BIMMessage message)
java

收到的消息被修改。(内容+扩展)

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。
BIMResultCallback
public interface com.bytedance.im.core.api.interfaces.BIMResultCallback
java

结果回调。

成员函数
返回名称
voidonSuccess
voidonFailed
函数说明

onSuccess
void com.bytedance.im.core.api.interfaces.BIMResultCallback.onSuccess(
    T t)
java

成功回调。

传入参数

参数名类型说明
tT回调数据

onFailed
void com.bytedance.im.core.api.interfaces.BIMResultCallback.onFailed(
    BIMErrorCode code)
java

失败回调。

传入参数

参数名类型说明
codeBIMErrorCode错误码,参看 BIMErrorCode。
BIMSendCallback
public abstract class com.bytedance.im.core.api.interfaces.BIMSendCallback
java

发送结果回调。

成员函数
返回名称
voidonProgress
voidonSaved
abstract voidonSuccess
abstract voidonError
函数说明

onProgress
public void com.bytedance.im.core.api.interfaces.BIMSendCallback.onProgress(
    BIMMessage message,
    int progress)
java

媒体消息上传进度。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。
progressint上传进度。

onSaved
public void com.bytedance.im.core.api.interfaces.BIMSendCallback.onSaved(
    BIMMessage bimMessage)
java

消息已保存。

传入参数

参数名类型说明
bimMessageBIMMessage消息体,参看 BIMMessage。

onSuccess
public abstract void com.bytedance.im.core.api.interfaces.BIMSendCallback.onSuccess(
    BIMMessage bimMessage)
java

消息发送成功。

传入参数

参数名类型说明
bimMessageBIMMessage消息体,参看 BIMMessage。

onError
public abstract void com.bytedance.im.core.api.interfaces.BIMSendCallback.onError(
    BIMMessage bimMessage,
    BIMErrorCode code)
java

消息发送失败。

传入参数

参数名类型说明
bimMessageBIMMessage消息体,参看 BIMMessage。
codeBIMErrorCode错误码,参看 BIMErrorCode。
BIMSimpleCallback
public abstract class com.bytedance.im.core.api.interfaces.BIMSimpleCallback
java

完成回调。

成员函数
返回名称
abstract voidonSuccess
abstract voidonFailed
函数说明

onSuccess
public abstract void com.bytedance.im.core.api.interfaces.BIMSimpleCallback.onSuccess()
java

成功。

onFailed
public abstract void com.bytedance.im.core.api.interfaces.BIMSimpleCallback.onFailed(
    BIMErrorCode code)
java

失败。

传入参数

参数名类型说明
codeBIMErrorCode错误码,参看 BIMErrorCode。
BIMSyncServerListener
public interface com.bytedance.im.core.api.interfaces.BIMSyncServerListener
java

同步服务端会话、消息数据监听。

成员函数
返回名称
voidonSyncServerStart
voidonSyncServerFinish
voidonSyncServerFailed
函数说明

onSyncServerStart
void com.bytedance.im.core.api.interfaces.BIMSyncServerListener.onSyncServerStart()
java

开始同步服务端会话、消息数据。

onSyncServerFinish
void com.bytedance.im.core.api.interfaces.BIMSyncServerListener.onSyncServerFinish()
java

同步服务端会话、消息数据成功。

onSyncServerFailed
void com.bytedance.im.core.api.interfaces.BIMSyncServerListener.onSyncServerFailed()
java

同步服务端会话、消息数据失败。

BIMLiveConversationListener
public interface com.bytedance.im.live.api.BIMLiveConversationListener
java

直播群成员事件回调监听方。

成员函数
返回名称
voidonConversationChanged
函数说明

onConversationChanged
void com.bytedance.im.live.api.BIMLiveConversationListener.onConversationChanged(
    BIMConversation conversation)
java

直播群信息发生变化。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation。
BIMLiveGroupMemberEventListener
public interface com.bytedance.im.live.api.BIMLiveGroupMemberEventListener
java

直播群成员事件回调监听方。

成员函数
返回名称
voidonMemberJoined
voidonMemberLeave
voidonMemberKicked
voidonMemberOwnerChanged
voidonMemberSilent
voidonAllMemberSilent
函数说明

onMemberJoined
void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onMemberJoined(
    BIMConversation conversation,
    List<BIMMember> memberList)
java

本接口不建议使用,将在未来版本废弃。

成员加入直播群。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation。
memberListList成员列表,参看 BIMMember。

onMemberLeave
void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onMemberLeave(
    BIMConversation conversation,
    List<BIMMember> memberList)
java

本接口不建议使用,将在未来版本废弃。

成员离开直播群。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation。
memberListList成员列表,参看 BIMMember。

onMemberKicked
void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onMemberKicked(
    BIMConversation conversation,
    List<BIMMember> memberList,
    long operatorID)
java

成员被踢出直播群。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation。
memberListList成员列表,参看 BIMMember。
operatorIDlong操作用户 UID

onMemberOwnerChanged
void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onMemberOwnerChanged(
    BIMConversation conversation,
    long fromUID,
    long toUID)
java

群主发生变化。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation。
fromUIDlong旧群主 UID。
toUIDlong新群主 UID。

onMemberSilent
void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onMemberSilent(
    BIMConversation conversation,
    List<BIMMember> memberSilentList,
    BIMBlockStatus status,
    long operatorId)
java

群成员被禁言。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation。
memberSilentListList禁言、取消成员列表
statusBIMBlockStatus禁言状态,参看 BIMBlockStatus。
operatorIdlong操作用户 UID

onAllMemberSilent
void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onAllMemberSilent(
    BIMConversation conversation,
    BIMBlockStatus status,
    long operatorId)
java

禁言、取消会话(禁言、取消所有人)。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation。
statusBIMBlockStatus禁言状态,参看 BIMBlockStatus。
operatorIdlong操作用户 UID。
BIMLiveMessageListener
public interface com.bytedance.im.live.api.BIMLiveMessageListener
java

消息监听方。

成员函数
返回名称
voidonReceiveMessage
voidonSendMessage
voidonDeleteMessage
voidonUpdateMessage
函数说明

onReceiveMessage
void com.bytedance.im.live.api.BIMLiveMessageListener.onReceiveMessage(
    BIMMessage message)
java

收到新消息。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。

onSendMessage
void com.bytedance.im.live.api.BIMLiveMessageListener.onSendMessage(
    BIMMessage message)
java

发送消息入库完成。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。

onDeleteMessage
void com.bytedance.im.live.api.BIMLiveMessageListener.onDeleteMessage(
    BIMMessage message)
java

收到的消息被删除。

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。

onUpdateMessage
void com.bytedance.im.live.api.BIMLiveMessageListener.onUpdateMessage(
    BIMMessage message)
java

收到的消息被修改。(内容+扩展)

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage。