botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Hero card text not showing in facebook

Open pankajGODB opened this issue 8 years ago • 14 comments

For hero card text wrap is not possible? In Emulator its worked but in fb the same is not working kindly can you guys provide any solution for this

heroemulator ===> Emulator screenshot herofb ===> Fb screenshot

Below is the used code

var card = new builder.HeroCard(session) .title('BotFramework Hero Card') .subtitle('Your bots — wherever your users are talking') .text('Build and connect intelligent bots to interact with your users naturally wherever they are, from text/sms to Skype, Slack, Office 365 mail and other popular services.') .images([ builder.CardImage.create(session, 'https://sec.ch9.ms/ch9/7ff5/e07cfef0-aa3b-40bb-9baa-7c9ef8ff7ff5/buildreactionbotframework_960.jpg') ]) .buttons([ builder.CardAction.imBack(session, 'GetMessage', 'Get Started') ]); var msg = new builder.Message(session).addAttachment(card); session.send(msg);

pankajGODB avatar Jun 28 '18 11:06 pankajGODB

Facebook controls how a card is rendered on messenger platform. For now, facebook template only have a field for title and subtitle. This is why you can't see the text which you are sending in hero card.

For now, you can try to use adaptive cards, if it fits your use case scenario. Be aware, that for now adaptive cards are also not fully supported and are down-rendered to image in many cases.

Kartik1607 avatar Jun 28 '18 15:06 Kartik1607

To extend on what @Kartik1607 said every channel has their own limitation on how rich content is rendered. THis includes text length, title length, number of buttons, etc.

JasonSowers avatar Jun 28 '18 15:06 JasonSowers

@Kartik1607 Thanks for your advice. I have tried the same using Adaptive card but that too is not working. Is there any other alternative to use text as wraped with images and button?

@JasonSowers Then how will we use bot for facebook with these features?

pankajGODB avatar Jun 28 '18 15:06 pankajGODB

If the restrictions on generic templates, which are documented here of the Facebook API do not work to suit your needs, you will need to find another way to display your information in the bot. There isnt any changes we can make to the SDK to allow this. It is a limitation of Facebook messenger. If you need to display an image with text and buttons you could try the combination of sending the image and text and using suggested actions/quick replys for your buttons.

JasonSowers avatar Jun 28 '18 16:06 JasonSowers

@JasonSowers Thanks for your help. Really looking for further more features ifs there please suggest me.

pankajGODB avatar Jun 28 '18 16:06 pankajGODB

@pankajGODB You would need to think of creative ways how you can send information to user overcoming the limitation of a channel.

You do not need to provide a single card for all channels. I would recommend going to channel documents, and learning best practices for that channel. Then you can always send different cards on different channels.

Kartik1607 avatar Jun 28 '18 17:06 Kartik1607

@Kartik1607 I have tried many features but while trying some more things, not worked for fb. That's why come here for help. I have already went through the document. Thank for you help.

pankajGODB avatar Jun 28 '18 17:06 pankajGODB

Good luck!

JasonSowers avatar Jun 28 '18 17:06 JasonSowers

In hero card button text is not showing can you please help on this?

screenshot 18

pankajGODB avatar Jul 27 '18 07:07 pankajGODB

Same here. I'm using c# and recently update my bot, now all buttons are just 3 dots!

Noc2 avatar Jul 27 '18 07:07 Noc2

Same here.. It was working fine since morning but now I am getting 3 dots in all the buttons..

fj4870 avatar Jul 27 '18 08:07 fj4870

@pankajGODB @Noc2 @fj4870 You are commenting on a closed issue that is not related to what you are reporting, please open a new issue and we can address the problem there

JasonSowers avatar Jul 27 '18 14:07 JasonSowers

@JasonSowers Thanks, but Facebook already fixed it.

Noc2 avatar Jul 27 '18 14:07 Noc2

Good to hear

JasonSowers avatar Jul 27 '18 14:07 JasonSowers