Node.js:Messenger广播消息不起作用

时间:2018-07-16 17:33:23

标签: javascript node.js request facebook-messenger facebook-messenger-bot

我正在尝试通过我的facebook Messenger机器人发送广播。这是我的代码:

if (subscribe === true) {
  // Send the HTTP request to the Messenger Platform
  request({
    "uri": "https://graph.facebook.com/v2.11/me/broadcast_messages",
    "qs": { "access_token": PAGE_ACCESS_TOKEN },
    "method": "POST",
    "message_creative_id": message_creative_id,
"notification_type": "REGULAR",
"messaging_type": "MESSAGE_TAG",
"tag": "NON_PROMOTIONAL_SUBSCRIPTION"
  }, (err, res, body) => {
    if (!err) {
      console.log('message sent!')
    } else {
      console.error("Unable to send message:" + err);
    }
  });
}

但是,没有消息发送给我的任何用户。我的代码是错误的,还是发送消息要花费很多时间?

1 个答案:

答案 0 :(得分:0)

我当时没有启用订阅消息,因此此问题无效。

相关问题