Reputation:
I am creating a bot using MS bot framework and I can't create a button that would call a phone number. This should be possible according to this - http://docs.botframework.com/en-us/csharp/builder/sdkreference/attachments.html - search under "action types" (call).
This is the code that is supposed to create a button in a HeroCard / ThumbnailCard, but it doesn't work. The whole card doesn't show up in the reply. If I comment out that code, the HeroCard / ThumbnailCard shows up normally. (I have another button with the type openUrl which works fine).
In the code below, button1 doesn't work while button2 appears normally if I comment out the code for button1.
UPDATE: it turns out the code works fine when I'm talking to the bot through Telegram, but doesn't work when I'm talking to the bot through Facebook Messenger.
List<CardAction> buttons = new List<CardAction>();
CardAction button1 = new CardAction()
{
Value = "tel:123123123123",
Type = "Call",
Title = "Call us"
};
buttons.Add(button1);
if (button2Text != null)
{
CardAction button2 = new CardAction()
{
Value = button2Value,
Type = button2ActionType,
Title = button2Text
};
buttons.Add(button2);
}
if (cardClassName == "HeroCard")
{
HeroCard card = new HeroCard()
{
Title = cardTitle,
Subtitle = cardSubtitle,
Images = images,
Buttons = buttons
};
Attachment a = card.ToAttachment();
msg.Attachments.Add(a);
}
else if (cardClassName == "ThumbnailCard")
{
ThumbnailCard card = new ThumbnailCard()
{
Title = cardTitle,
Subtitle = cardSubtitle,
Images = images,
Buttons = buttons
};
Attachment a = card.ToAttachment();
msg.Attachments.Add(a);
}
Upvotes: 1
Views: 889
Reputation: 3549
Just change the type to openUrl and it will work with values of type: "tel: +xx xxx xxx xxxx"
Upvotes: 1
Reputation: 10573
Facebook currently does not support a bot escalating to a phone call
Upvotes: 1