消息发送
说明
发送的方法说明发送文本消息
发送图片消息
自己上传图片需要实现上传文件的数据源 参考:上传文件数据源
发送自定义消息
参考自定义消息: 自定义消息消息监听
监听发送消息状态
消息发送状态码(ReasonCode)
当消息发送后,通过addMessageStatusListener 监听返回的 SendackPacket 中包含 reasonCode。以下是各状态码的说明:
| 值 | 名称 | 说明 |
|---|---|---|
| 0 | ReasonUnknown | 未知错误 |
| 1 | ReasonSuccess | 成功 |
| 2 | ReasonAuthFail | 认证失败 |
| 3 | ReasonSubscriberNotExist | 订阅者在频道内不存在 |
| 4 | ReasonInBlacklist | 在黑名单列表里 |
| 5 | ReasonChannelNotExist | 频道不存在 |
| 6 | ReasonUserNotOnNode | 用户没在节点上 |
| 7 | ReasonSenderOffline | 发送者离线,消息发送失败 |
| 8 | ReasonMsgKeyError | 消息key错误,消息不合法 |
| 9 | ReasonPayloadDecodeError | payload解码失败 |
| 10 | ReasonForwardSendPacketError | 转发发送包失败 |
| 11 | ReasonNotAllowSend | 不允许发送消息 |
| 12 | ReasonConnectKick | 连接被踢 |
| 13 | ReasonNotInWhitelist | 没在白名单内 |
| 14 | ReasonQueryTokenError | 查询用户token错误 |
| 15 | ReasonSystemError | 系统错误 |
| 16 | ReasonChannelIDError | 错误的频道ID |
| 17 | ReasonNodeMatchError | 节点匹配错误 |
| 18 | ReasonNodeNotMatch | 节点不匹配 |
| 19 | ReasonBan | 频道被封禁 |
| 20 | ReasonNotSupportHeader | 不支持的header |
| 21 | ReasonClientKeyIsEmpty | clientKey 是空的 |
| 22 | ReasonRateLimit | 速率限制 |
| 23 | ReasonNotSupportChannelType | 不支持的频道类型 |
| 24 | ReasonDisband | 频道已解散 |
| 25 | ReasonSendBan | 发送被封禁 |
监听常规消息
监听cmd消息
历史消息
需要实现同步频道消息数据源 参考:同步频道消息数据源
获取某个频道的历史消息

