内置消息说明

在野火IM系统中内置消息和自定义消息没有什么区别,唯一的区别就是内置消息是野火团队预先定义好的,自定义消息是客户自主添加的。阅读本章节,需要先详细阅读和真正理解几个概念:消息内容消息负载自定义消息内容

在服务器端,任何消息发送的格式都是MessagePayload

本章节内容讲述,使用server api如何发送内置消息,其他自定义消息也可以参考。

1. 发送格式

在server api中的message api中有个发送消息的接口。接口的payload参数内容包括

{
  "type":1,
  "searchableContent":"hello",
  "pushContent":"",
  "pushData":"",
  "content":"",
  "base64edData":"",
  "mediaType":0,
  "remoteMediaUrl":"",
  "persistFlag":3,
  "expireDuration":0,
  "mentionedType":0,
  "mentionedTarget":[],
  "extra":"",
}
  1. type为消息内容的类型。
  2. searchableContent,可搜索内容,当一个消息可以被搜索时,这个字段填写被搜索的内容。
  3. pushContent,当自定义消息需要推送时,这里存放推送显示的内容。
  4. pushData,当自定义消息推送时,需要一些数据,这里是推送数据。
  5. base64edData,跟客户端定义的binaryContent是同一个字段,唯一的区别就是客户端是二进制数据,这里是二进制数据做base64编码的字符串。
  6. mediaType,媒体文件的类型,0是通用,1是图片,2是语音,3是视频,4是文件,5是头像,6是收藏,7是动态表情,8是朋友圈。
  7. persistFlag,是存储标志,在客户端定义在消息类中,不在消息对象中。
  8. expireDuration,是消息过期时间,单位是秒,在客户端是在发送函数中的参数。
  9. mentionedType,@信息类型,0是无@,1是@部分人,2是@全体成员。
  10. mentionedTarget,被@的人员列表,仅当mentionedType为1时有效。
  11. extra,扩展字段,消息内容的基类有个extra字段,对应到MessagePayload中的这个字段。

服务器端的MessagePayload和客户端的MessagePayload大致相同,只有部分表达方式不一样。

本章节只能给出部分消息的说明,如果本说明没有提到的消息,可以找到客户端源代码中消息内容的encode或者decode方法,找到客户端消息与客户端MessagePayload的转换规则,从而得到服务器端的MessagePayload。

2. 不可发送消息

有些消息是不能通过server API发送的,包括如下:

  1. 撤回和删除消息。
  2. 群组各种通知消息。
  3. 密聊会话消息。
  4. 音视频通话信令消息。
  5. 朋友圈通知消息。
  6. 对讲语音消息。

3. 文本消息

{
  "type":1,
  "persistFlag":3,
  "searchableContent":"hello world",
}

json中类型为1,存储标志为3,searchableContent存放文本消息的内容。

如果文本消息@某人,mentionedType值为1,mentionedTarget为被@的对象。如果@所有人,mentionedType值为2。加上mention信息的json为:

{
  "type":1,
  "persistFlag":3,
  "searchableContent":"hello world",
  "mentionedType":1,
  "mentionedTarget":["user1", "user2"]
}

如果文本消息引用某条消息,引用的json为:

{
  "quote":{
    "u":messageUid,
    "i":"userId",
    "n":"user nick name",
    "d":"message digest"  
  }
}

u为消息的uid,i为发送着的用户id,n为发送者的昵称,d为消息的摘要。此json字符串的字节做base64编码,放到base64edData字段中。加上引用内容的文本消息json为:

{
  "type":1,
  "persistFlag":3,
  "searchableContent":"hello world",
  "mentionedType":1,
  "mentionedTarget":["user1", "user2"],
  "base64edData":"ewogICJxdW90ZSI6ewogICAgInUiOm1lc3NhZ2VVaWQsCiAgICAiaSI6InVzZXJJZCIsCiAgICAibiI6InVzZXIgbmljayBuYW1lIiwKICAgICJkIjoibWVzc2FnZSBkaWdlc3QiICAKICB9Cn0=",
}

4. 语音消息

{
  "type":2,
  "persistFlag":3,
  "searchableContent":"[声音]",
  "mediaType":2,
  "content":"{\"duration\":7}",
  "remoteMediaUrl":"https://media.wfcoss.cn/firechat/voice_message_sample.amr"
}

remoteMediaUrl存放语音文件的链接,content是个json格式字符串,里面存储语音消息的时长。

5. 图片消息

{
  "type":3,
  "persistFlag":3,
  "searchableContent":"[图片]",
  "mediaType":1,
  "remoteMediaUrl":"https://media.wfcoss.cn/firechat/image_message_sample.jpg",
  "searchableContent":"[图片]",
  "base64edData":"/9j/4AAQSkZJRgABAQAASABIAAD/4QCARXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAKgAgAEAAAAAQAAAHigAwAEAAA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t4rlqYqdRcl7ddPyLp4qUKfK9VfY8VsxqCRiYRPNbglQDkg9emDnjrxVz7U//Pg35S//ABVes4CzOq8AR9B9ajrtWN1a5Tpoykly32P/2Q=="
}

remoteMediaUrl存放图片消息的链接,base64edData为图片的缩略图。缩略图的生成规则是,把图片压缩到120X120大小的方框内,45%的质量压缩为JPG格式,再把二进制做base64编码得到字符串。

6. 位置消息

{
  "type":4,
  "persistFlag":3,
  "searchableContent":"中国北京市海淀区阜成路北二街131号",
  "content":"{\"lat\":39.926537312885166,\"long\":116.32154022158235}",
  "base64edData":"/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAALSgAwAEAAAAAQAAAHgAAAAA/8AAEQgAeAC0AwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx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gG6jv04JHao7iB4YHnKuViUuWUnOFGenIqt2i/3I/5Vv3n/ACCbr/rhJ/6BW0YptXIcnqea3/i4WEcQuLW48yd/LMeV3AYQ7sNgkYcdB1/Ona3rF0llfQWcKx3KTQQpJP5gRjNIq5I2pnarA8E5zXN+M/8AkP2H+f4beuh8W/cl/wCv6x/9Ct6+ojgqPNB8vX9TwKmLq2lr/VmVfBeo3Wp3N35kttdwiKKWCW2V1yJJJVbIYnoyHFehY/eIUVgRk4J64xXj3wT/AOPD/txg/wDSm6r2j/lvH9G/pXlZzRjSxUoU1Zafkd+W1JVMPGcnr/wSs7MzvvUYJHUnsBx0P1qLyo2OAq8+h/8AsRU8vf8A3/8A2QVFF94V46PUGQyxbMvCTk5ByOnapfNtv+eB/MVVj/1Uf+6KdRyom5//2Q=="
}

content是一个json字符串,包含经纬度:

{
  "lat":39.926537312885166,
  "long":116.32154022158235
}

searchableContent为地理位置的文本描述,content为一个json字符串,包含经纬度,base64edData为位置的缩略图。缩略图的生成规则是,把图片压缩到120X120大小的方框内,45%的质量压缩为JPG格式,再把二进制做base64编码得到字符串。

7. 文件消息

{
  "type":5,
  "persistFlag":3,
  "searchableContent":"野火产品简介.key",
  "mediaType":4,
  "content":"38394",
  "remoteMediaUrl":"https://media.wfcoss.cn/firechat/file_message_sample.pptx"
}

content存放的为文件大小,searchableContent存放文件名。

8. 视频消息

{
  "type":6,
  "persistFlag":3,
  "searchableContent":"[视频]",
  "mediaType":3,
  "content":"{\"d\":3,\"duration\":3}",
  "base64edData":"/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAESgAwAEAAAAAQAAAHgAAAAA/8AAEQgAeABEAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQ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Deoavr6T7jfQ/yr5Dv/8Aj6f/AHquImfR15JDP4WhvZdit5Me5247Acmuf8Da3DJfXGmIQwI3Aj1GAcVb1T/knv8A2xj/AKVwnw4/5GFv91v6UlsUz6W05/3Lf739BV/dWZpv+pb/AHv6CtCkI//Z",
  "remoteMediaUrl":"https://media.wfcoss.cn/firechat/video_message_sample.mov"}

content是个json字符串,里面存放视频的时长,注意里面为了兼容某些版本,有2个字段是视频时长;base64edData为视频的缩略图。缩略图的生成规则是,选取视频首帧图片,图片压缩到120X120大小的方框内,45%的质量压缩为JPG格式,再把二进制做base64编码得到字符串。

9. 动态表情消息

{
  "type":7,
  "persistFlag":3,
  "searchableContent":"[动态表情]",
  "mediaType":7,
  "base64edData":"eyJ4Ijo3NTMsInkiOjk2MH0=",
  "remoteMediaUrl":"https://media.wfcoss.cn/firechat/sticker_message_sample.jpg"}

base64edData是一个json字符串的字节做base64编码得到的字符串。json的格式如下,是表情的尺寸。

{
  "x":width,
  "y":"height"
}

10. 链接消息

{
  "type":8,
  "persistFlag":3,
  "searchableContent":"产品介绍 · 野火IM开发手册",
  "base64edData":"eyJ1IjoiaHR0cHM6XC9cL2RvY3Mud2lsZGZpcmVjaGF0LmNuXC8iLCJ0IjoiaHR0cHM6XC9cL2RvY3Mud2lsZGZpcmVjaGF0LmNuXC9mYXZpY29uLmljbyJ9"
}

base64edData是一个json字符串的字节做base64编码得到的字符串。json的格式为:

{
  "d":"链接的摘要",
  "u":"链接的URL",
  "t":"缩略图的链接地址"
}

11. 名片消息

{
  "type":10,
  "persistFlag":3,
  "content":"cgc8c8VV",
  "base64edData":"eyJkIjoi5aSn6ZuoIiwicCI6Imh0dHBzOlwvXC9tZWRpYS53ZmNvc3MuY25cL3N0YXRpY1wvWTJkak9HTTRWbFktM0QtNS0xNjY2NDI5OTY4LUdwTTE5VzNINjQ4MC5wbmciLCJuIjoiMTY4OCIsImYiOiJKY2dtTG01NSJ9"
}

content是目标ID(可能是用户id,群组id,频道ID等,根据t决定)。base64edData是一个json字符串的字节做base64编码得到的字符串。json的格式为:

{
  "t":0,
  "f":"来源用户ID",
  "n":"目标的名称",
  "d":"目标的昵称",
  "p":"目标的头像"
}

t是名片的类型,0是用户,1是群组,2是频道。当是用户名片时,n是用户的账户(name),d是用户的昵称(displayName),当不是用户时,这2个都是一样的,是群组或者频道的名称。如果有需要扩展更多类型,也是可以的,需要服务器和客户端对齐。

12. 组合消息

{
  "type":11,
  "persistFlag":3,
  "searchableContent":"[声音] [声音] Untitled.key Hello ",
  "mediaType":0,
  "content":"大雨和Mr Dinosaur02 的聊天记录",
  "base64edData":"eyJtcyI6W3sidWlkIjo0MzA4NDM4MTQ4NTMyMTQzMzgsImN0eXBlIjoyLCJmcm9tIjoiSmNnbUxtNTUiLCJ0eXBlIjowLCJjYyI6IntcImR1cmF0aW9uXCI6Mn0iLCJ0YXJnZXQiOiJjZ2M4YzhWViIsInNlcnZlclRpbWUiOjE3MjAxNzgzNDAzMDQsImNzYyI6Ilvlo7Dpn7NdIiwibXJ1IjoiaHR0cHM6XC9cL21lZGlhLndmY29zcy5jblwvbWVkaWFcL1NtTm5iVXh0TlRVLTNELTItMTcyMDE3ODMzOS1keHRvWDJ3NmsweEcuYW1yIiwibGUiOiIiLCJzdGF0dXMiOjEsIm10IjoyfSx7ImRpcmVjdGlvbiI6MSwidWlkIjo0MzI1ODQzMDA4MzgyNTY3NzAsImN0eXBlIjoyLCJmcm9tIjoiY2djOGM4VlYiLCJ0eXBlIjowLCJjYyI6IntcImR1cmF0aW9uXCI6NX0iLCJ0YXJnZXQiOiJjZ2M4YzhWViIsInNlcnZlclRpbWUiOjE3MjEwMDgyNjg2OTUsImNzYyI6Ilvlo7Dpn7NdIiwibXJ1IjoiaHR0cHM6XC9cL21lZGlhLndmY29zcy5jblwvbWVkaWFcL1kyZGpPR000VmxZLTNELTItMTcyMTAwODI2OC1VamF6dDFWY0hjbnkuYW1yIiwibGUiOiIiLCJzdGF0dXMiOjcsIm10IjoyfSx7ImRpcmVjdGlvbiI6MSwidWlkIjo0MzI1ODU2MjAxNzk2NDg2NDIsImN0eXBlIjo1LCJmcm9tIjoiY2djOGM4VlYiLCJ0eXBlIjowLCJjYyI6IjU2NDQ3MSIsInRhcmdldCI6ImNnYzhjOFZWIiwic2VydmVyVGltZSI6MTcyMTAwODg5NzgwNiwiY3NjIjoiVW50aXRsZWQua2V5IiwibXJ1IjoiaHR0cHM6XC9cL21lZGlhLndmY29zcy5jblwvbWVkaWFcL1kyZGpPR000VmxZLTNELTQtMTcyMTAwODg5Ny16SmZnUUM2QW9aM2Yua2V5IiwibGUiOiIiLCJzdGF0dXMiOjYsIm10Ijo0fSx7InN0YXR1cyI6MSwidWlkIjo0MzI1OTUxMDE1NTQ4MzU1ODYsInRhcmdldCI6ImNnYzhjOFZWIiwic2VydmVyVGltZSI6MTcyMTAxMzQxODg3OCwiZnJvbSI6IkpjZ21MbTU1IiwiY3NjIjoiSGVsbG8iLCJ0eXBlIjowLCJjdHlwZSI6MX1dfQ==",
  "remoteMediaUrl":""
}

base64edData是一个json字符串的字节做base64编码得到的字符串,json包含消息列表。json的格式为:

{
"ms":[
    {
      "uid":430843814853214338,
      "type":0,
      "target":"cgc8c8VV",
      "line":0,
      "from":"JcgmLm55",
      "direction":0,
      "ctype":2,
      "cc":"{\"duration\":2}",
      "serverTime":1720178340304,
      "csc":"[声音]",
      "mru":"https://media.wfcoss.cn/media/SmNnbUxtNTU-3D-2-1720178339-dxtoX2w6k0xG.amr",
      "le":"",
      "status":1,
      "mt":2
    },
    {
      "uid":432584300838256770,
      "type":0,
      "target":"cgc8c8VV",
      "line":0,
      "from":"cgc8c8VV",
      "direction":1,
      "ctype":2,
      "cc":"{\"duration\":5}",
      "serverTime":1721008268695,
      "csc":"[声音]",
      "mru":"https://media.wfcoss.cn/media/Y2djOGM4VlY-3D-2-1721008268-Ujazt1VcHcny.amr",
      "le":"",
      "status":7,
      "mt":2
    },
    {
      "uid":432585620179648642,
      "type":0,
      "target":"cgc8c8VV",
      "line":0,
      "from":"cgc8c8VV",
      "direction":1,
      "ctype":5,
      "cc":"564471",
      "serverTime":1721008897806,
      "csc":"Untitled.key",
      "mru":"https://media.wfcoss.cn/media/Y2djOGM4VlY-3D-4-1721008897-zJfgQC6AoZ3f.key",
      "le":"",
      "status":6,
      "mt":4
    },
    {
      "uid":432595101554835586,
      "type":0,
      "target":"cgc8c8VV",
      "line":0,
      "from":"JcgmLm55",
      "direction":0,
      "status":1,
      "serverTime":1721013418878,
      "csc":"Hello",
      "ctype":1
    }
  ]
}
  1. "uid"为消息的UID。
  2. "type"、"target"和"line"构成会话。
  3. "from"消息的发送者。
  4. "direction"消息的方向,0是发送,1是接收。
  5. "ctype":消息MessagePlayload的类型。
  6. "csc" 消息MessagePlayload的searchableContent字段。
  7. "cpc" 消息MessagePlayload的pushContent字段。
  8. "cpd" 消息MessagePlayload的pushData字段。
  9. "cc" 消息MessagePlayload的content字段。
  10. "cbc" 消息MessagePlayload的base64edData字段。
  11. "cmt" 消息MessagePlayload的mentionedType字段。
  12. "cmts" 消息MessagePlayload的mentionedTargets字段。
  13. "ce" 消息MessagePlayload的extra字段。
  14. "mt" 消息MessagePlayload的mediaType字段。
  15. "mru"消息MessagePlayload的remoteMediaUrl字段。
  16. "status":消息的状态。
  17. "serverTime":消息的时间

如果消息内容太多,base64edData太大,超过消息最大的大小限制(50KB),那么base64edData只存放前面3条消息内容,remoteMediaUrl存放整个消息列表json的内容。

13. 富通知消息

{
  "type":12,
  "persistFlag":3,
  "pushContent":"产品审核通知",
  "content":"您好,您的SSL证书以审核通过并成功办理,请关注",
  "base64edData":"ewogICJyZW1hcmsiOiLosKLosKLmg6Dpob4iLAogICJleE5hbWUiOiLor4HkuablsI/liqnmiYsiLAogICJleFBvcnRyYWl0IjoiIiwKICAiZXhVcmwiOiJodHRwczovL3d3dy5iYWlkdS5jb20iLAogICJhcHBJZCI6IjEyMzQ1Njc4OTAiLAogICJkYXRhcyI6WwogICAgewogICAgICAia2V5Ijoi55m76ZmG6LSm5oi3IiwKICAgICAgInZhbHVlIjoi6YeO54GrSU0iLAogICAgICAiY29sb3IiOiIjMTczMTc3IgogICAgfSwKICAgIHsKICAgICAgImtleSI6IuS6p+WTgeWQjeensCIsCiAgICAgICJ2YWx1ZSI6IuWfn+WQjXdpbGRpZnJlY2hhdC5jbueUs+ivt+eahOWFjei0uVNTTOivgeS5piIsCiAgICAgICJjb2xvciI6IiMxNzMxNzciCiAgICB9LAogICAgewogICAgICAia2V5Ijoi5a6h5qC46YCa6L+HIiwKICAgICAgInZhbHVlIjoi6YCa6L+HIiwKICAgICAgImNvbG9yIjoiIzE3MzE3NyIKICAgIH0sCiAgICB7CiAgICAgICJrZXkiOiLor7TmmI4iLAogICAgICAidmFsdWUiOiLor7fnmbvpmYbotKbmiLfmn6XnnIvlpITnkIYiLAogICAgICAiY29sb3IiOiIjMTczMTc3IgogICAgfQogIF0KfQ=="
}

base64edData是一个json字符串的字节做base64编码得到的字符串。json的格式为:

{
  "remark":"谢谢惠顾",
  "exName":"证书小助手",
  "exPortrait":"",
  "exUrl":"https://www.baidu.com",
  "appId":"1234567890",
  "datas":[
    {
      "key":"登陆账户",
      "value":"野火IM",
      "color":"#173177"
    },
    {
      "key":"产品名称",
      "value":"域名wildifrechat.cn申请的免费SSL证书",
      "color":"#173177"
    },
    {
      "key":"审核通过",
      "value":"通过",
      "color":"#173177"
    },
    {
      "key":"说明",
      "value":"请登陆账户查看处理",
      "color":"#173177"
    }
  ]
}

14. 文章消息

{
  "type":13,
  "persistFlag":3,
  "searchableContent":"文章头条的标题",
  "base64edData":"ewogICJ0b3AiOnsKICAgICJpZCI6IuaWh+eroElEIiwKICAgICJjb3ZlciI6IuaWh+eroOWwgemdouWbvueJh3VybCIsCiAgICAidGl0bGUiOiLmlofnq6DnmoTmoIfpopgiLAogICAgImRpZ2VzdCI6IuaWh+eroOeahOaRmOimgSIsCiAgICAidXJsIjoi5paH56ug55qE5Zyw5Z2AIiwKICAgICJyciI6dHJ1ZQogIH0sCiAgc3ViQXJ0aWNsZXM6WwogICAgewogICAgICAiaWQiOiLmlofnq6BJRCIsCiAgICAgICJjb3ZlciI6IuaWh+eroOWwgemdouWbvueJh3VybCIsCiAgICAgICJ0aXRsZSI6IuaWh+eroOeahOagh+mimCIsCiAgICAgICJkaWdlc3QiOiLmlofnq6DnmoTmkZjopoEiLAogICAgICAidXJsIjoi5paH56ug55qE5Zyw5Z2AIiwKICAgICAgInJyIjp0cnVlCiAgICB9LAogICAgewogICAgICAiaWQiOiLmlofnq6BJRCIsCiAgICAgICJjb3ZlciI6IuaWh+eroOWwgemdouWbvueJh3VybCIsCiAgICAgICJ0aXRsZSI6IuaWh+eroOeahOagh+mimCIsCiAgICAgICJkaWdlc3QiOiLmlofnq6DnmoTmkZjopoEiLAogICAgICAidXJsIjoi5paH56ug55qE5Zyw5Z2AIiwKICAgICAgInJyIjp0cnVlCiAgICB9LAogICAgewogICAgICAiaWQiOiLmlofnq6BJRCIsCiAgICAgICJjb3ZlciI6IuaWh+eroOWwgemdouWbvueJh3VybCIsCiAgICAgICJ0aXRsZSI6IuaWh+eroOeahOagh+mimCIsCiAgICAgICJkaWdlc3QiOiLmlofnq6DnmoTmkZjopoEiLAogICAgICAidXJsIjoi5paH56ug55qE5Zyw5Z2AIiwKICAgICAgInJyIjp0cnVlCiAgICB9CiAgXQp9"
}

base64edData是一个json字符串的字节做base64编码得到的字符串。json的格式为:

{
  "top":{
    "id":"文章ID",
    "cover":"文章封面图片url",
    "title":"文章的标题",
    "digest":"文章的摘要",
    "url":"文章的地址",
    "rr":true
  },
  subArticles:[
    {
      "id":"文章ID",
      "cover":"文章封面图片url",
      "title":"文章的标题",
      "digest":"文章的摘要",
      "url":"文章的地址",
      "rr":true
    },
    {
      "id":"文章ID",
      "cover":"文章封面图片url",
      "title":"文章的标题",
      "digest":"文章的摘要",
      "url":"文章的地址",
      "rr":true
    },
    {
      "id":"文章ID",
      "cover":"文章封面图片url",
      "title":"文章的标题",
      "digest":"文章的摘要",
      "url":"文章的地址",
      "rr":true
    }
  ]
}

json中的rr是readreport的缩写,当为true时,客户端在用户打开文章时,需要上报阅读信息。

15. 流式内容正在生成消息

{
  "type":14,
  "persistFlag":4,
  "searchableContent":"正在生成的全量文本内容。。。",
  "content":"流的ID"
}

persistFlag为4,说明是透传消息,与其他消息不同。

16. 流式内容生成完成消息

{
  "type":15,
  "persistFlag":4,
  "searchableContent":"生成的全量文本内容",
  "content":"流的ID"
}

persistFlag为3。

17. 提醒消息(小灰条)

"type":90,
"persistFlag":4,
"content":"最近诈骗活动猖獗,请注意防范各种诈骗活动。",

18. 自定义消息

自定义消息可以把各种数据放到服务端的MessagePayload中,然后客户端来实现客户端的MessagePayload和自定义消息的转换。

2018 © wildfirechat.net 京ICP备18060403号-1 all right reserved,powered by Gitbook该文件修订时间: 2024-07-19 15:42:47

results matching ""

    No results matching ""