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

Question : How to send native Facebook card asynchronously

Open josh-a-dcosta opened this issue 10 years ago • 4 comments

Hi, I would like to send a native fb card, using bot.send(), Can you please tell me what I am doing wrong below,

var nativeMsg = new builder.Message(); var nativeMsg2 = nativeMsg.sourceEvent(args); bot.send(nativeMsg2);

"args" is JSON, {"facebook": {"notification_type": "REGULAR","attachment": {"type": "template","payload": {"template_type": "generic","elements": [{"title": "Some Title", "image_url": "http://docs.botframework.com/images/demo_bot_image.png","subtitle": "Some amazing subtitle","buttons": [{"type": "postback","title": "GO", "payload": "demo"}]}]}}}}

ps: I dont have session object in this call, its invoked asynchronously as a pro-active message

josh-a-dcosta avatar Nov 17 '16 12:11 josh-a-dcosta

Try sending just the inner part of the json: {"notification_type": "REGULAR","attachment": {"type": "template","payload": {"template_type": "generic","elements": [{"title": "Some Title", "image_url": "http://docs.botframework.com/images/demo_bot_image.png","subtitle": "Some amazing subtitle","buttons": [{"type": "postback","title": "GO", "payload": "demo"}]}]}}}

craigjensen avatar Nov 17 '16 23:11 craigjensen

Did you get this to work? You DO need the outer "facebook": part

Stevenic avatar Nov 26 '16 05:11 Stevenic

Hi Steve I just got it to with this weekend Yes the outer part is needed

Thanks

On Sat, Nov 26, 2016 at 12:52 AM Steven Ickman [email protected] wrote:

Did you get this to work? You DO need the outer "facebook": part

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/1686#issuecomment-263046014, or mute the thread https://github.com/notifications/unsubscribe-auth/AFbZaHnaEf-KMDX0jge5c47EOVXHFwB8ks5rB8kXgaJpZM4K1PEu .

josh-a-dcosta avatar Nov 26 '16 16:11 josh-a-dcosta

It sounds like your problem is solved, so I am closing this issue.

chrimc62 avatar Nov 28 '16 01:11 chrimc62