微信小程序-发送订阅消息

发送微信订阅消息一直出错

user refuse to accept the msg rid: 5ff8563e-2acaf6dc-75492f03

This API has been unsupported hint

踩坑记录

真正的订阅消息文档

流程文档

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

调用数据文档

https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html

 

只有这个api可以使用

templateSend: 'https://api.weixin.qq.com/cgi-bin/message/subscribe/send'

这些全部不行

templateSend2: 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send',
templateSend3: 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send'

首先第一步需要调用,如果找不到就硬写, 千万不要<button open-type="subscribe"></button> 这个虽然授权了, 根本没用, 应该是永久模板使用的。 跟我们没有关系

一定要加,不然收不到。鼻子都气歪了

wx.requestSubscribeMessage({
  tmplIds: ["模板id"],
  success (res) { }
})

第二步, 发送订阅消息,此消息只能发送一次,第二次要重新授权

 const {
      access_token,
      open_id
    } = this.props;
    const data2 = {
      touser: open_id,
      template_id: "模板id",
      page: "/pages/page/index",
      data: {
        thing1: {
          value: "酒店"
        },
        thing4: {
          value: "起床"
        }
      }
    }
    api.templateSend(access_token, data2)
      .then((res) => {
        console.log(res);
      })

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值