{% if platform == ‘wechat’ %}

获取微信订阅消息可用订阅记录数量(SDK >= v3.3)

{% else %}

获取 QQ 订阅消息可用订阅记录数量(SDK >= v3.10)

{% endif %}

用于检查订阅消息模版的订阅记录数量,以保证用户可以收到订阅消息通知(如下单提醒)

{% if platform == ‘wechat’ %} BaaS.wechat.getSubscribeMsgTicketCount(options) {% else %} BaaS.qq.getSubscribeMsgTicketCount(options) {% endif %}

参数说明

options(类型:Object),属性说明:

属性 类型 必填 说明
userID Integer 用户 ID (对应 _userprofile 表中的 id 字段)
subscriptionType String 订阅类型,目前只支持 once(一次性订阅)
templateID String 订阅消息模版 id

请求示例

{% if platform == ‘wechat’ %}

  1. BaaS.useVersion('v3.3')
  2. exports.main = async function(event) {
  3. return await BaaS.wechat.getSubscribeMsgTicketCount({
  4. userID: "...",
  5. templateID: "...",
  6. subscriptionType: "once",
  7. })
  8. }

{% else %}

  1. BaaS.useVersion('v3.3')
  2. exports.main = async function(event) {
  3. return await BaaS.qq.getSubscribeMsgTicketCount({
  4. userID: "...",
  5. templateID: "...",
  6. subscriptionType: "once",
  7. })
  8. }

{% endif %}

返回示例

  1. {
  2. "error": {},
  3. "code": 0,
  4. "data": 10
  5. }