Messenger persistent menu not visible

ⅰ亾dé卋堺 提交于 2020-01-04 03:38:21

问题


I'm currently developing a Facebook messenger bot. However, I can't attach a persistent menu to it.

I read the requirements here:

The user must be on Messenger v106 or above on iOS or Android.
The page the bot is attached to must be published.
The bot must be set to "public" in the developer console.
The bot must have passed the approval process for pages_messaging permission

And all those are met.

When I set the menu, I receive this feedback from Facebook:

Array
(
    [result] => success
)

However, it's still not displayed neither on my Android device, nor in the web Facebook. I deleted the conversation and re-entered several times, with no success.

By the way, I'm using this lib for Graph api, just in case.


回答1:


Okay, the point is that you have to send an array of menus for every locale, but strangely Facebook doesn't warn in case your request is wrong




回答2:


Xameeramir, I meant something like this. Notice how the menus are different for each locale.

curl -X POST -H "Content-Type: application/json" -d '{
"persistent_menu":[
    {
      "locale":"default",
      "composer_input_disabled":true,
      "call_to_actions":[
        {
          "title":"My Account",
          "type":"nested",
          "call_to_actions":[
            {
              "title":"Pay Bill",
              "type":"postback",
              "payload":"PAYBILL_PAYLOAD"
            },
            {
              "title":"History",
              "type":"postback",
              "payload":"HISTORY_PAYLOAD"
            },
            {
              "title":"Contact Info",
              "type":"postback",
              "payload":"CONTACT_INFO_PAYLOAD"
            }
          ]
        },
        {
          "type":"web_url",
          "title":"Latest News",
          "url":"http://petershats.parseapp.com/hat-news",
          "webview_height_ratio":"full"
        }
      ]
    },
    {
      "locale":"zh_CN",
      "composer_input_disabled":false
    }
  ]
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=YOUR_ACCESS_TOKEN_HERE"


来源:https://stackoverflow.com/questions/43757320/messenger-persistent-menu-not-visible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!