Search code examples
facebookbuttonbotframeworkfacebook-messengerfacebook-messenger-bot

Microsoft Bot Framework: buttons not working on facebook channel


I'm building a bot using Microsoft Bot Framework. The bot is running on Facebook, Telegram and Skype, but in the facebook channel, buttons are not working as expected. When I click a button on Telegram or Skype, everything works and the bot answers correctly, but when I click a button using facebook, It seems that the bot doesn't receive the message. It isn't a problem of the bot, because if I write explicitly the content of the button, the bot receive the message, but not if I click the button.

How can I fix that?

EDIT: Here it is the code of the buttons

public enum OsOptions { NotSelected = 0, ANDROID, IPHONE, IPAD, PC}    

[Prompt("Please, select the target OS or write its name below. {||}")]
public OsOptions Os { get; set; }

public static IForm<LinkForm> BuildForm()
{
        var form = new FormBuilder<LinkForm>()
                        .AddRemainingFields()
                        .OnCompletion(async (context, state) =>
                        {
                            await context.PostAsync("The form has been completed.");
                        });

        return form.Build();
}

Solution

  • Make sure that in the Facebook app settings, in the Messenger/webhook part that you select messages and messaging postback Image from Facebook Docs