消息类型 (ContentType) 与通知码对照表
三端(iOS / Android / Web)收发的所有消息(MsgStruct / IMMessage)均通过 contentType 区分普通聊天消息与系统通知消息。
1. 基础聊天消息类型 (101 ~ 120)
contentType | iOS IMMessageContentType | 消息元素字段 (MsgStruct) | 说明 |
|---|---|---|---|
101 | .text | textElem | 纯文本消息 |
102 | .picture | pictureElem | 图片消息(含原图、大图、缩略图) |
103 | .sound | soundElem | 语音消息 |
104 | .video | videoElem | 视频消息(含视频与首帧封面图) |
105 | .file | fileElem | 文件消息 |
106 | .atText | atTextElem | 群聊 @ 提醒消息 |
107 | .merge | mergeElem | 合并转发聊天记录消息 |
108 | .card | cardElem | 个人名片消息 |
109 | .location | locationElem | 地理位置消息 |
110 | .custom | customElem | 自定义业务消息 |
113 | .typing | typingElem | 正在输入信令消息(底层自动处理) |
114 | .quote | quoteElem | 引用回复消息 |
115 | .face | faceElem | 自定义表情消息 |
117 | .advancedText | advancedTextElem | 富文本实体消息 |
2. 好友关系通知类型 (1201 ~ 1210)
contentType | iOS IMMessageContentType | 说明 |
|---|---|---|
1201 | .friendApplicationApprovedNotification | 好友申请被对方同意 |
1202 | .friendApplicationRejectedNotification | 好友申请被对方拒绝 |
1203 | .friendApplicationNotification | 收到新的好友申请 |
1204 | .friendAddedNotification | 添加好友成功通知 |
1205 | .friendDeletedNotification | 好友被删除通知 |
1206 | .friendRemarkSetNotification | 好友备注修改同步通知 |
1207 | .blackAddedNotification | 加入黑名单通知 |
1208 | .blackDeletedNotification | 移除黑名单通知 |
1209 | .friendInfoUpdatedNotification | 好友个人资料更新通知 |
1210 | .friendsInfoUpdateNotification | 好友扩展属性(置顶/备注)更新通知 |
3. 群组与系统通知类型 (1501 ~ 2103)
contentType | iOS IMMessageContentType | 说明 |
|---|---|---|
1501 | .groupCreatedNotification | 群组创建成功通知 |
1502 | .groupInfoSetNotification | 群资料变更通知 |
1503 | .joinGroupApplicationNotification | 收到加群申请通知 |
1504 | .memberQuitNotification | 群成员退群通知 |
1505 | .groupApplicationAcceptedNotification | 加群申请获批通知 |
1506 | .groupApplicationRejectedNotification | 加群申请被拒通知 |
1507 | .groupOwnerTransferredNotification | 群主转让通知 |
1508 | .memberKickedNotification | 群成员被踢出通知 |
1509 | .memberInvitedNotification | 邀请群成员入群通知 |
1510 | .memberEnterNotification | 新成员入群通知 |
1511 | .groupDismissedNotification | 群组解散通知 |
1512 | .groupMemberMutedNotification | 群成员被禁言通知 |
1513 | .groupMemberCancelMutedNotification | 群成员解除禁言通知 |
1514 | .groupMutedNotification | 群开启全员禁言通知 |
1515 | .groupCancelMutedNotification | 群关闭全员禁言通知 |
1516 | .groupMemberInfoSetNotification | 群成员资料修改通知 |
1517 | .groupMemberSetToAdminNotification | 群成员被设为管理员通知 |
1518 | .groupMemberSetToOrdinaryUserNotification | 群管理员被取消权限通知 |
1519 | .groupInfoSetAnnouncementNotification | 群公告更新通知 |
1520 | .groupInfoSetNameNotification | 群名称修改通知 |
1701 | .burnAfterReadingNotification | 阅后即焚状态变更通知 |
2001 | .businessNotification | 自定义业务透传通知 |
2101 | .revokedNotification | 消息撤回灰条通知 |