【问题标题】:Persistent menu not showing in Facebook Messenger chat botFacebook Messenger 聊天机器人中未显示持久菜单
【发布时间】:2017-10-14 20:41:30
【问题描述】:

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

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

无论如何都不应该是locale specific。甚至I don't see here

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

喜欢my brother,到目前为止我有tried almost everything

This looks like some crazy bug。是否有一些解决方法可以添加一个最简单的持久菜单?

【问题讨论】:

  • 当您在/messenger_profile 上发送GET 时,您看到更新反映了吗?
  • @amuramoto 一定会检查并返回!顺便说一句,如果我点击/messenger_profile,我们会得到什么
  • 您还需要 fields=persistent_menu Parma。您将取回定义菜单的存储对象。 developers.facebook.com/docs/messenger-platform/reference/…

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


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    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/"
                }
              ]
            }
          ]
        }
      ]
    }
    

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

    【讨论】:

    • 我试过这个答案,并解决了信使电话应用程序的问题。 Messenger 网络上一切正常,但持久菜单的更改并未反映在手机应用中。
    • @AhmedShendy 该更改应反映在 Web 和移动设备上。不知道怎么可能……
    • 我认为你是对的,它适用于网络版和手机版的 Messenger,很抱歉造成混淆。
    猜你喜欢
    • 1970-01-01
    • 2016-08-14
    • 1970-01-01
    • 2020-03-28
    • 1970-01-01
    • 1970-01-01
    • 2019-01-03
    • 1970-01-01
    • 2017-03-25
    相关资源
    最近更新 更多