收藏
回答

小程序订阅消息,订阅成功,消息下发接口也返回成功,但是服务通知收不到消息?

前端:
wx.requestSubscribeMessage({
  tmplIds: ['GAP8yjAX_F9SqZfWhhJ-SwgFIV-jhKLz4VXSPXjprlA'],
  success (res) {
  console.log("res:"+res)
 }
})
后端:
public void msgSend(WxSubscribeMsgRequest wxSubscribeMsgRequest) {
    
    Map<String, TemplateDataRequest> map = new HashMap<>(5);
    map.put("thing", new TemplateDataRequest("有人下单啦!"));
    wxSubscribeMsgRequest.setData(map);

    log.info("发送消息,请求参数:[{}]", JSON.toJSONString(wxSubscribeMsgRequest));
    Response<WxSubscribeMsgResponse> response = httpWechatAppApi.subscribeSend(wxSubscribeMsgRequest);
    log.info("发送消息,返回结果:[{}]", JSON.toJSONString(response));
}

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容