Share button of FB v1.4

(Galaxy Lam) #1

In the Facebook messenger v1.4, we can make the share button to share the bot content to others.
Reference : https://developers.facebook.com/docs/messenger-platform/send-api-reference/share-button

May I know how to achieve it in Flow XO ? Do we need to make the bot linking with own Facebook APP?

I used simple login page method and applied “Bot - Make a Custom Request”, pasted the example Json code, but it didn’t work.

Many thanks.

(Daniel Beckett) #2

When using the Bot - Make a Custom Request action we take care of some of the elements that Facebook is expecting so a slight alteration needs to be made to Facebook’s example JSON. An example of a working custom request is as follows:

   {
    "attachment":{
      "type":"template",
      "payload":{
        "template_type":"generic",
        "elements":[
          {
            "title":"Breaking News: Record Thunderstorms",
            "subtitle":"The local area is due for record thunderstorms over the weekend.",
            "image_url":"https://pbs.twimg.com/profile_images/623862903909838848/gCkaPPnA.png",
            "buttons":[
              {
                "type":"element_share"
              }              
            ]
          }
        ]
      }
    }
}

You can also install my example flow if you want to see it in action.

Hope that helps :slightly_smiling_face:

Thanks,
Dan

2 Likes
(Pablo Cambre) #3

Is there any way to capture when user taps over the share button? or even better is there any way to know if user shares the element suggested by the bot?.
I would like to trigger some logic if happen this event.
Thanks!

(Daniel Beckett) #4

Hi Pablo,

You could look into using a postback. You can then capture the payload information in your Flow to know if the share button has been clicked.

Thanks,
Dan

#5

Hi @DanielBeckett, thanks for sharing this flow. Very helpful. Do you know if there is a way to rename the ‘Share’ button? I’d like to translate it into French. Tks

(Karen Barker) #6

Hi @Kloic

The Share button on Facebook should be automatically translated into whatever language the user has his Facebook profile set up in. :thumbsup:

#7

Hi @KarenBarker. I just tested this by changing my profile language to French and the “Get Started” that first trigger the bot was translated to French but both the “Share” or “Send Location” buttons were not translated and remain in English :disappointed:

Would u have a workaround ?

Tks