报告一个bug
发布于 3 年前 作者 qinxiuying 3562 次浏览 来自 官方Issues

https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html

文档里面描述 推送到服务器的解构是

{
  "ToUserName": "gh_123456789abc",
  "FromUserName": "o7esq5OI1Uej6Xixw1lA2H7XDVbc",
  "CreateTime": "1620973045",
  "MsgType": "event",
  "Event": "subscribe_msg_popup_event",
  "SubscribeMsgPopupEvent": [   {
        "TemplateId": "hD-ixGOhYmUfjOnI8MCzQMPshzGVeux_2vzyvQu7O68",
        "SubscribeStatusString": "accept",
        "PopupScene": "0"
    }],
 }

而实际推送的是

{
  "ToUserName": "gh_123456789abc",
  "FromUserName": "o7esq5OI1Uej6Xixw1lA2H7XDVbc",
  "CreateTime": "1620973045",
  "MsgType": "event",
  "Event": "subscribe_msg_popup_event",
  "List": [   {
        "TemplateId": "hD-ixGOhYmUfjOnI8MCzQMPshzGVeux_2vzyvQu7O68",
        "SubscribeStatusString": "accept",
        "PopupScene": "0"
    }],
 }

请问是文档描述有问题,还是接口有问题?

2 回复

你的反馈我们已收到,先以实际收到的为准,文档后续会更新。

更新一下,如果只有一个模板,实际收到的 是

{
  "ToUserName": "gh_123456789abc",
  "FromUserName": "o7esq5OI1Uej6Xixw1lA2H7XDVbc",
  "CreateTime": "1620973045",
  "MsgType": "event",
  "Event": "subscribe_msg_popup_event",
  "List": {
        "TemplateId": "hD-ixGOhYmUfjOnI8MCzQMPshzGVeux_2vzyvQu7O68",
        "SubscribeStatusString": "accept",
        "PopupScene": "0"
    }
 }

List竟然都不是数组,而是一个对象,猜测是多个的时候是数组,单个的时候是对象,这让服务端统一处理很为难

回到顶部