持久菜单未在Facebook Messenger聊天机器人中显示

时间:2017-10-14 20:41:31

标签: facebook facebook-graph-api facebook-messenger messenger facebook-messenger-bot

As I don't know why suggested, using Postman.

Per docs,已成功将配置发布到facebook API:

enter image description here

不应该是locale specific。甚至I don't see here

  

本地化:开发人员现在可以为您的机器人用户可能来自的每个本地提供多种语言(或完全不同的菜单)的文本。

my brother一样,我到目前为止已tried almost everything

This looks like some crazy bug。是否有一些工作要添加一个最简单的持久性菜单?

2 个答案:

答案 0 :(得分:5)

在这个问题上浪费了2个小时。直到我意识到你必须删除对话然后用忽略缓存刷新facebook(ctrl + shift + r in chrome)然后它会显示。

答案 1 :(得分:0)

FB API document表示用于将持久性菜单应用于页面特定机器人的API链接是:

https://graph.facebook.com/v2.6/me/messenger_profile?access_token=<PAGE_ACCESS_TOKEN>

请注意版本号之后的 me ,在此特定情况下为v2.6。但是,this did not worked for a lot of people

要点击的API链接发生微小变化:

<强> graph.facebook.com/v2.6 / Page ID / messenger_profile?的access_token = PAGE ACCESS TOKEN

请注意, me 将替换为fb Page Id。

样本有效负载仍然可以相同:

{
  "get_started": {
    "payload": "Get started"
  },
  "persistent_menu": [
    {
      "locale": "default",
      "composer_input_disabled": false,
      "call_to_actions": [
        {
          "title": "Stop notifications",
          "type": "nested",
          "call_to_actions": [
            {
              "title": "For 1 week",
              "type": "postback",
              "payload": "For_1_week"
            },
            {
              "title": "For 1 month",
              "type": "postback",
              "payload": "For_1_month"
            },
            {
              "title": "For 1 year",
              "type": "postback",
              "payload": "For_1_year"
            }
          ]
        },
        {
          "title": "fresh jobs",
          "type": "postback",
          "payload": "fresh jobs"
        },
        {
          "title": "More",
          "type": "nested",
          "call_to_actions": [
            {
              "title": "like us",
              "type": "web_url",
              "url": "https://www.facebook.com/nordible/"
            },
            {
              "title": "blog",
              "type": "web_url",
              "url": "http://xameeramir.github.io/"
            }
          ]
        }
      ]
    }
  ]
}

请注意,在设置get_started之前必须配置persistent_menu按钮。