1

I want to implement share button inside my chatbot. On click of share button the message will get shared with selected contact list. Image FB_ChatBot.png is what I am trying to implement inside my chatbot and Share_Btn_Output

enter image description here

This png is output produced by share button clicked.

halfer
  • 19,824
  • 17
  • 99
  • 186
chetan mekha
  • 665
  • 6
  • 18
  • Possible duplicate of [Share Button In Facebook Messenger](https://stackoverflow.com/questions/42318597/share-button-in-facebook-messenger) – Ezequiel Jadib May 26 '17 at 10:39
  • @EzequielJadib any sample code available in node js, regarding it's implementation. – chetan mekha May 27 '17 at 15:37
  • @EzequielJadib i am able to achieve it for single share button, but how can i show 2 buttons in card view format, like as above image – chetan mekha May 31 '17 at 07:33

2 Answers2

2

It's an late update but will save someone usefull time. With help of below code you can show multiple buttons on facebook chatbot. Technology used for development is node js,botbuilder,luis.

var msg = new builder.Message(session);
            msg.sourceEvent({
                "facebook": {
                    "attachment": {
                        "type": "template",
                        "payload": {
                            "template_type": "button",
                            "text": "You can either hit 'FAQ' to get the help, or head to the Mannual Help for getting help.",
                            "buttons": [
                                {
                                    "type": "web_url",
                                    "url": 'https://stackoverflow.com/',
                                    "title": "Mannual Help"
                                },
                                {
                                    "type": "postback",
                                    "title": "FAQ",
                                    "payload": "FAQ_SELECTED_BY_USER"
                                }]
                        }
                    }
                }
            });
            session.send(msg);

enter image description here

chetan mekha
  • 665
  • 6
  • 18
1

I am able to show share button with below code but still struct with showing two button (1 View and 2 Share) inside cards. Below solution will work for showing share button in chatbot platform used Node js.

var msg = new builder.Message(session);
        msg.sourceEvent({
            facebook: {
                attachment: {
                    type: "template",
                    payload: {
                        template_type: "generic",
                        elements: [{
                            title: "title",
                            subtitle: "subtitle",
                            image_url: "https://external.xx.fbcdn.net/safe_image.php?d=AQBIbeQ2vl8bb5tl&url=http%3A%2F%2Fimagizer.imageshack.us%2F196x92f%2F924%2FySQ7a9.png&_nc_hash=AQAv9cZ-0jAr9REX",
                            item_url: "url",
                            buttons: [{
                                type: "element_share"
                            }]
                        }]
                    }
                }
            }
        });
        session.send(msg);

Output image below,enter image description here

chetan mekha
  • 665
  • 6
  • 18