Closed chenlin4653 closed 2 years ago
请参考 https://docs.wildfirechat.cn/base_knowledge/custom_message_content.html 里面有这么一段,服务器发送的是客户端encode之后的格式,需要跟客户端对齐。另外客户端也需要按照这个说明来定义和注册消息
使用Server API发送消息是与客户端不同的,在Server API发送的是Encode之后的MessagePayload。所以如果您想要在服务器端发送某个消息(自定义和内置消息都是一样的),就必须使用跟客户端一样的规则Encode生成MessagePayload,并且MessagePayload里的二进制数据是经过base64转码的。
目前 android 和 iOS 通过 binaryContent 字段 ,使用 JSONObject 手动解析 里面的内容,binaryContent byte[] , 服务端 MessagePayload 没有 此 此段?Server API发送消息 MessagePayload里的二进制数据是经过base64转码的? 二进制内容 是不是 对应 客户端 MessageContent ? 客户端 没有看到 base64 解码 ?
MessagePayload
里面的base64edData
对应客户端的binaryContent
字段,base64edData
需要进行base64编码。binaryContent
已经是原始的二进制数据了。
请求 服务端 发送 自定义 消息,需要参考什么格式,移动端(android 、iOS) 消息体 content 一直没有值 ,谢谢。