1
votes

We are trying to get the persistent menu working on the Facebook channel with the bot framework.

See docs here…

The JSON we send matches the example in the second link above, and is very basic:

"persistent_menu": [
      {
        "locale": "default",
        "composer_input_disabled": true,
        "call_to_actions": [
          {
            "type": "postback",
            "title": "Help"
          },
          {
            "type": "postback",
            "title": "Home"
          }
        ]
      }
    ]

When we send this to the Facebook channel, simply nothing happens.

Any ideas? Thanks in advance.

2
I'm seeing simple JSON code. Can you explain how do you send it to Facebook ?Bob Swager
What do you mean by When we send this to the Facebook channel? This JSON must be sent using Facebook API, there is no direct link with Bot Framework. Then you can get the call to actions in your bot, but it's another thingNicolas R
Did you get it to working. I am facing the same issue. stackoverflow.com/questions/47449678/…NoodlesMM11

2 Answers

0
votes

For Persistent menus with callback buttons, it is reccomended to use suggested actions instead. below is an example:

    var reply = activity.CreateReply("I have colors in mind, but need your help to choose the best one.");
    reply.Type = ActivityTypes.Message;
    reply.TextFormat = TextFormatTypes.Plain;

    reply.SuggestedActions = new SuggestedActions()
    {
        Actions = new List<CardAction>()
        {
            new CardAction(){ Title = "Blue", Type=ActionTypes.ImBack, Value="Blue" },
            new CardAction(){ Title = "Red", Type=ActionTypes.ImBack, Value="Red" },
            new CardAction(){ Title = "Green", Type=ActionTypes.ImBack, Value="Green" }
        }
    };
0
votes

Try this

Command line:

curl -X POST -H "Content-Type: application/json" -d @persistent_menu.json "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=

{
   "persistent_menu": [
       "locale": "default",
       "composer_input_disabled": true,
       "call_to_actions": [
           {
              "title": "Title",
              "type": "postback",
              "payload "Title",
           },
           {
              "title": "Title 2",
              "type": "postback",
              "payload "Title 2",
           }
       ]
   ]
}