skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

    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"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search