类型: 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 已经更改 消息被撤回, 被删除等也会触发这个事件 |
| MessageUpsert | 'message-upsert' | 在消息更新时触发 |
| ConversationChange | 'conversation-change' | 在会话, 或会话内的消息发生变更时触发 |
| ConversationUpsert | 'conversation-upsert' | 在会话更新时触发 |
| ConversationDissolve | 'conversation-dissolve' | 在会话解散时触发 |
| 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' | 消息属性变更 |
| InitLoadPage | 'init-load-page' | 初始化拉取历史消息,分页 |
| InitFinish | 'init-finish' | 初始化成功完成 |
| TokenExpired | 'token-expired' | Token 过期 |
| ConversationOwnerChange | 'ConversationOwnerChange' | 群主变更(用于直播群),v1.1.0 新增 |
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.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.ParticipantUpsert]: Participant;
[IMEvent.ParticipantJoin]: {
participants: Participant[];
onlineMemberCount?: number;
};
[IMEvent.ParticipantLeave]: {
participants: Participant[];
onlineMemberCount?: number;
operatorType?: number;
};
[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;
};
}
ts