You need to enable JavaScript to run this app.
导航

回调

最近更新时间2024.03.11 19:19:40

首次发布时间2023.04.24 11:11:45

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

长链状态监听方。

成员函数

返回名称
voidonConnectStatusChanged
voidonTokenInvalid

函数说明

onConnectStatusChanged

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

长链状态改变回调。

传入参数

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

onTokenInvalid

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

Token 失效回调。

传入参数

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

会话监听方。

成员函数

返回名称
voidonNewConversation
voidonConversationChanged
voidonConversationDelete
voidonTotalUnreadMessageCountChanged
voidonConversationRead

函数说明

onNewConversation

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

获取到新的会话。

传入参数

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

onConversationChanged

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

会话发生更新。

传入参数

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

onConversationDelete

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

会话被删除。

传入参数

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

onTotalUnreadMessageCountChanged

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

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

传入参数

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

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

onConversationRead

void com.bytedance.im.core.api.interfaces.BIMConversationListListener.onConversationRead(
    String conversationId,
    long fromUid)

收到会话已读回执。

传入参数

参数名类型说明
conversationIdString会话ID。
fromUidlong发送会话已读回执的用户ID。
BIMLogListener
public interface com.bytedance.im.core.api.interfaces.BIMLogListener

日志监听方。

成员函数

返回名称
voidonLog

函数说明

onLog

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

主线程日志回调。

传入参数

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

消息监听方。

成员函数

返回名称
voidonReceiveMessage
voidonSendMessage
voidonDeleteMessage
voidonRecallMessage
voidonUpdateMessage
voidonReceiveMessagesReadReceipt

函数说明

onReceiveMessage

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

收到新消息。

传入参数

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

onSendMessage

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

发送消息入库完成。

传入参数

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

onDeleteMessage

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

收到的消息被删除。

传入参数

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

onRecallMessage

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

收到的消息被撤回。

传入参数

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

onUpdateMessage

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

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

传入参数

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

onReceiveMessagesReadReceipt

void com.bytedance.im.core.api.interfaces.BIMMessageListener.onReceiveMessagesReadReceipt(
    List<BIMMessageReadReceipt> receiptList)

收到消息已读回执。

传入参数

参数名类型说明
receiptListList消息体,参看 BIMMessageReadReceipt
BIMResultCallback
public abstract class com.bytedance.im.core.api.interfaces.BIMResultCallback

结果回调。

成员函数

返回名称
abstract voidonSuccess
abstract voidonFailed

函数说明

onSuccess

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

成功回调。

传入参数

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

onFailed

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

失败回调。

传入参数

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

发送结果回调。

成员函数

返回名称
voidonProgress
voidonSaved
abstract voidonSuccess
abstract voidonError

函数说明

onProgress

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

媒体消息上传进度。

传入参数

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

onSaved

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

消息已保存。

传入参数

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

onSuccess

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

消息发送成功。

传入参数

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

onError

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

消息发送失败。

传入参数

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

完成回调。

成员函数

返回名称
abstract voidonSuccess
abstract voidonFailed

函数说明

onSuccess

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

成功。

onFailed

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

失败。

传入参数

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

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

成员函数

返回名称
voidonSyncServerStart
voidonSyncServerFinish
voidonSyncServerFailed

函数说明

onSyncServerStart

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

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

onSyncServerFinish

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

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

onSyncServerFailed

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

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

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

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

成员函数

返回名称
voidonConversationChanged

函数说明

onConversationChanged

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

直播群信息发生变化。

传入参数

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

直播群标记类型回调监听方。

成员函数

返回名称
voidonMarkTypesAdd
voidonMarkTypesDeleted

函数说明

onMarkTypesAdd

void com.bytedance.im.live.api.BIMLiveGroupMarkTypeListener.onMarkTypesAdd(
    BIMConversation conversation,
    BIMLiveGroupMarkTypeChangeInfo changeInfo)

直播群新增标记类型。

传入参数

参数名类型说明
changeInfoBIMLiveGroupMarkTypeChangeInfo标记更新信息,参看 BIMLiveGroupMarkTypeChangeInfo
conversationBIMConversation会话信息,参看 BIMConversation

onMarkTypesDeleted

void com.bytedance.im.live.api.BIMLiveGroupMarkTypeListener.onMarkTypesDeleted(
    BIMConversation conversation,
    BIMLiveGroupMarkTypeChangeInfo changeInfo)

直播群删除标记类型。

传入参数

参数名类型说明
changeInfoBIMLiveGroupMarkTypeChangeInfo标记更新信息,参看 BIMLiveGroupMarkTypeChangeInfo
BIMLiveGroupMemberEventListener
public abstract class com.bytedance.im.live.api.BIMLiveGroupMemberEventListener

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

成员函数

返回名称
voidonMemberJoined
voidonMemberLeave
abstract voidonMemberKicked
abstract voidonMemberOwnerChanged
abstract voidonMemberSilent
abstract voidonAllMemberSilent
abstract voidonAddAdmin
abstract voidonRemoveAdmin
abstract voidonMemberInfoChanged
voidonBatchMemberInfoChanged

函数说明

onMemberJoined

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

成员加入群聊。

传入参数

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

onMemberLeave

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

成员退出群聊。

传入参数

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

onMemberKicked

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

成员被踢出直播群。

传入参数

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

onMemberOwnerChanged

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

群主发生变化。

传入参数

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

onMemberSilent

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

群成员被禁言。

传入参数

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

onAllMemberSilent

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

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

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation
statusBIMBlockStatus禁言状态,参看 BIMBlockStatus
operatorIdlong操作用户 ID。

onAddAdmin

public abstract void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onAddAdmin(
    BIMConversation conversation,
    List<BIMMember> adminList,
    long operatorId)

添加管理员。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation
adminListList添加的管理员列表,参看 BIMMember
operatorIdlong操作用户 ID。

onRemoveAdmin

public abstract void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onRemoveAdmin(
    BIMConversation conversation,
    List<BIMMember> uidList,
    long operatorId)

添加管理员移除管理员。

传入参数

参数名类型说明
conversationBIMConversation会话信息, 参看 BIMConversation
uidListList移出的管理员列表,参看 BIMMember
operatorIdlong操作用户 ID。

onMemberInfoChanged

public abstract void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onMemberInfoChanged(
    BIMConversation conversation,
    BIMMember member)

成员信息变更。

传入参数

参数名类型说明
conversationBIMConversation会话信息,参看 BIMConversation
memberBIMMember变更的群成员信息,参看 BIMMember

onBatchMemberInfoChanged

public void com.bytedance.im.live.api.BIMLiveGroupMemberEventListener.onBatchMemberInfoChanged(
    BIMConversation conversation,
    List<BIMMember> members)

批量成员信息变更。

传入参数

参数名类型说明
conversationBIMConversation会话信息,参看 BIMConversation
membersList批量变更的群成员信息,参看 BIMMember
BIMLiveMessageListener
public interface com.bytedance.im.live.api.BIMLiveMessageListener

消息监听方。

成员函数

返回名称
voidonReceiveMessage
voidonSendMessage
voidonDeleteMessage
voidonUpdateMessage

函数说明

onReceiveMessage

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

收到新消息。

传入参数

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

onSendMessage

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

发送消息入库完成。

传入参数

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

onDeleteMessage

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

收到的消息被删除。

传入参数

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

onUpdateMessage

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

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

传入参数

参数名类型说明
messageBIMMessage消息体,参看 BIMMessage
BIMFriendListener
public abstract class com.bytedance.im.user.api.BIMFriendListener

好友事件回调监听方。

成员函数

返回名称
abstract voidonFriendApply
abstract voidonFriendDelete
abstract voidonFriendUpdate
abstract voidonFriendAdd
abstract voidonFriendAgree
abstract voidonFriendRefuse
abstract voidonFriendApplyUnreadCountChanged
abstract voidonBlackListAdd
abstract voidonBlackListDelete
abstract voidonBlackListUpdate
abstract voidonUserProfileUpdate

函数说明

onFriendApply

public abstract void com.bytedance.im.user.api.BIMFriendListener.onFriendApply(
    BIMFriendApplyInfo applyInfo)

申请成为好友回调。

传入参数

参数名类型说明
applyInfoBIMFriendApplyInfo申请信息,参看 BIMFriendApplyInfo

onFriendDelete

public abstract void com.bytedance.im.user.api.BIMFriendListener.onFriendDelete(
    BIMUserFullInfo userFullInfo)

删除好友回调。

传入参数

参数名类型说明
userFullInfoBIMUserFullInfo好友信息,参看 BIMUserFullInfo

onFriendUpdate

public abstract void com.bytedance.im.user.api.BIMFriendListener.onFriendUpdate(
    BIMUserFullInfo userFullInfo)

好友信息变更回调。

传入参数

参数名类型说明
userFullInfoBIMUserFullInfo好友信息,参看 BIMUserFullInfo

onFriendAdd

public abstract void com.bytedance.im.user.api.BIMFriendListener.onFriendAdd(
    BIMUserFullInfo userFullInfo)

好友新增(同意好友)。

传入参数

参数名类型说明
userFullInfoBIMUserFullInfo好友信息,参看 BIMUserFullInfo

onFriendAgree

public abstract void com.bytedance.im.user.api.BIMFriendListener.onFriendAgree(
    BIMFriendApplyInfo applyInfo)

通过好友申请。

传入参数

参数名类型说明
applyInfoBIMFriendApplyInfo好友申请信息,参看 BIMFriendApplyInfo

onFriendRefuse

public abstract void com.bytedance.im.user.api.BIMFriendListener.onFriendRefuse(
    BIMFriendApplyInfo applyInfo)

拒绝好友申请。

传入参数

参数名类型说明
applyInfoBIMFriendApplyInfo好友申请信息,参看 BIMFriendApplyInfo

onFriendApplyUnreadCountChanged

public abstract void com.bytedance.im.user.api.BIMFriendListener.onFriendApplyUnreadCountChanged(
    int count)

好友申请未读数变化

传入参数

参数名类型说明
countint变化后的未读数。

onBlackListAdd

public abstract void com.bytedance.im.user.api.BIMFriendListener.onBlackListAdd(
    BIMUserFullInfo userFullInfo)

新添加黑名单回调。

传入参数

参数名类型说明
userFullInfBIMUserFullInfo好友信息,参看 BIMUserFullInfo

onBlackListDelete

public abstract void com.bytedance.im.user.api.BIMFriendListener.onBlackListDelete(
    BIMUserFullInfo userFullInfo)

删除黑名单回调。

传入参数

参数名类型说明
userFullInfoBIMUserFullInfo好友信息,参看 BIMUserFullInfo

onBlackListUpdate

public abstract void com.bytedance.im.user.api.BIMFriendListener.onBlackListUpdate(
    BIMUserFullInfo userFullInfo)

修改黑名单回调。

传入参数

参数名类型说明
userFullInfoBIMUserFullInfo好友信息,参看 BIMUserFullInfo

onUserProfileUpdate

public abstract void com.bytedance.im.user.api.BIMFriendListener.onUserProfileUpdate(
    BIMUserFullInfo userFullInfo)

用户信息更新回调。

传入参数

参数名类型说明
userFullInfoBIMUserFullInfo用户信息,参看 BIMUserFullInfo