You need to enable JavaScript to run this app.
文档中心
实时音视频

实时音视频

复制全文
下载 pdf
微信小程序
事件
复制全文
下载 pdf
事件
IMEvent ​
类型: enum​
IM SDK 事件名。​
成员​
​
属性​
值​
描述​
Error​
'error'​
内部抛出异常时触发​
WebSocketConnected​
'websocket-connected'​
长链建联​
WebSocketDisconnected​
'websocket-disconnected'​
长链断开​
WebSocketReceiveUnexpectedFrame​
'websocket-receive-unexpected-frame'​
WebSocket 收到了非预期 Service 的 Frame,可能来自业务侧​
ReceiveNewMessage​
'receive-new-message'​
通过混链补偿或长链推送收到新消息时触发(非 50000+ 新消息), 需要自己的消息也触发时启用 noticeSelfMessage​
ReceiveSelfMessage​
'receive-self-message'​
收到自己发送的消息​
ReceiveCommandMessage​
'receive-command-message'​
收到命令消息​
ReceiveNewUpdateExtMessage​
'receive-new-update-ext-message'​
收到 50002 消息时触发, 代表消息的 Ext 已经更改​
消息被撤回, 被删除等也会触发这个事件​
ReceiveNewP2PMessage​
'receive-new-p2p-message'​
收到自定义透传消息​
MessageUpsert​
'message-upsert'​
在消息更新时触发​
ConversationChange​
'conversation-change'​
在会话, 或会话内的消息发生变更时触发​
ConversationUpsert​
'conversation-upsert'​
在会话更新时触发​
ConversationDissolve​
'conversation-dissolve'​
在会话解散时触发​
ConversationClearMessage​
'conversation-clear-message'​
在会话消息被清空时触发(v1.20.0 新增)​
ConversationBlock​
'conversation-block'​
50011 全群禁言​
ParticipantUpsert​
'participant-upsert'​
群成员变更​
ParticipantJoin​
'participant-join'​
成员进群​
ParticipantLeave​
'participant-leave'​
成员离开群聊,主动退群或者被踢出群聊,包括自己​
ParticipantBlock​
'participant-block'​
会话内成员被禁言​
MessageSend​
'message-send'​
消息发送​
MessageRecall​
'message-recall'​
消息被撤回​
MessageDelete​
'message-delete'​
消息被删除​
ConversationDelete​
'conversation-delete'​
删除会话​
ConversationLeave​
'conversation-leave'​
离开会话 自己退群或者被踢出群聊​
ConversationCreate​
'conversation-create'​
创建会话​
ConversationJoin​
'conversation-join'​
加入会话 进群​
MessagePropertyUpsert​
'message-property-upsert'​
消息属性变更​
BotContextClear​
'bot-context-clear'​
AI机器人会话上下文变更​
InitLoadPage​
'init-load-page'​
初始化拉取历史消息,分页​
InitFinish​
'init-finish'​
初始化成功完成​
TokenExpired​
'token-expired'​
接口响应 Token 过期​
ConversationOwnerChange​
'conversation-owner-change'​
群主变更(用于直播群),v1.1.0 新增​
FriendApply​
'friend-apply'​
发起/收到好友申请​
FriendDelete​
'friend-delete'​
删除好友​
FriendAdd​
'friend-add'​
添加好友​
FriendApplyRefuse​
'friend-apply-refuse'​
好友请求被拒绝​
FriendApplyRead​
'friend-apply-read'​
好友请求已读(用于多端同步好友请求未读数)​
FriendApplyUpdate​
'friend-apply-update'​
好友申请更新​
FriendUpdate​
'friend-update'​
好友信息更新​
BlacklistAdd​
'blacklist-add'​
黑名单添加新条目​
BlacklistRemove​
'blacklist-remove'​
黑名单移除条目​
BlacklistUpdate​
'blacklist-update'​
黑名单条目更新​
ProfileUpdate​
'profile-update'​
用户资料更新(自己或好友)​
LiveGroupMarkTypeUpdate​
'live-group-mark-type-update'​
直播群含有的标记类型更新​
MessageRead​
'message-read'​
收到对端标记单条消息已读(v1.11.0 新增)​
ConversationMessageRead​
'conversation-message-read'​
收到对端标记整个会话消息已读(v1.11.0 新增)​
OnlineStateChange​
'online-state-change'​
收到对端在线状态变更​
​
IMEventTypeMap ​
SDK 事件对应的回调参数,参见 IMEvent。​
类型​
​
{​
[IMEvent.Error]: BaseError;​
[IMEvent.WebSocketConnected]: IMWebSocket;​
[IMEvent.WebSocketDisconnected]: IMWebSocket;​
[IMEvent.WebSocketReceiveUnexpectedFrame]: im_proto.IFrame;​
[IMEvent.ReceiveNewMessage]: Message;​
[IMEvent.ReceiveNewUpdateExtMessage]: Message;​
[IMEvent.ReceiveSelfMessage]: Message;​
[IMEvent.ReceiveNewP2PMessage]: P2PMessage<any>;​
[IMEvent.ReceiveCommandMessage]: CommandMessage<BaseCommandContentType>;​
[IMEvent.ConversationChange]: never;​
[IMEvent.ConversationUpsert]: Conversation;​
[IMEvent.ConversationDissolve]: Conversation;​
[IMEvent.ConversationDelete]: Conversation;​
[IMEvent.ConversationJoin]: Conversation;​
[IMEvent.ConversationLeave]: Conversation;​
[IMEvent.ConversationCreate]: Conversation;​
[IMEvent.ConversationBlock]: Conversation;​
[IMEvent.BotContextClear]: Message;​
[IMEvent.ParticipantUpsert]: Participant;​
[IMEvent.ParticipantJoin]: {​
participants: Participant[];​
onlineMemberCount?: number;​
};​
[IMEvent.ParticipantLeave]: {​
participants: Participant[];​
onlineMemberCount?: number;​
operatorType?: ParticipantLeaveOperatorType;​
};​
[IMEvent.ParticipantBlock]: Participant;​
[IMEvent.MessageUpsert]: Message;​
[IMEvent.MessageSend]: Message;​
[IMEvent.MessageDelete]: Message;​
[IMEvent.MessageRecall]: Message;​
[IMEvent.MessagePropertyUpsert]: Message;​
[IMEvent.InitLoadPage]: never;​
[IMEvent.InitFinish]: InitResult;​
[IMEvent.TokenExpired]: string;​
[IMEvent.ConversationOwnerChange]: {​
oldOwnerId: string;​
newOwnerId: string;​
};​
[IMEvent.FriendApply]: FriendApplyEventContent;​
[IMEvent.FriendDelete]: FriendDeleteEventContent;​
[IMEvent.FriendAdd]: FriendAddEventContent;​
[IMEvent.FriendApplyRefuse]: FriendApplyRefuseEventContent;​
[IMEvent.FriendApplyRead]: FriendApplyReadEventContent;​
[IMEvent.FriendApplyUpdate]: FriendApplyUpdateEventContent;​
[IMEvent.FriendUpdate]: FriendUpdateEventContent;​
[IMEvent.BlacklistAdd]: BlacklistAddEventContent;​
[IMEvent.BlacklistRemove]: BlacklistRemoveEventContent;​
[IMEvent.BlacklistUpdate]: BlacklistUpdateEventContent;​
[IMEvent.ProfileUpdate]: ProfileUpdateEventContent;​
[IMEvent.LiveGroupMarkTypeUpdate]: LiveGroupMarkTypeUpdateEventContent;​
[IMEvent.MessageRead]: P2PMessage<MessageReadEventContent>;​
[IMEvent.ConversationMessageRead]: P2PMessage<ConversationMessageReadEventContent>;​
[IMEvent.OnlineStateChange]: P2PMessage<OnlineStateChangeEventContent>;​
[IMEvent.ConversationClearMessage]: ConversationClearMessageEventContent;​
}​
​
​
最近更新时间:2026.07.16 20:09:26
这个页面对您有帮助吗?
有用
有用
无用
无用