Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share url in facebook messenger from web

I would like to share an url from a website (using mobile device) to facebook messenger app.

I tried to use:

FB.ui({
    method: 'send',
    link: 'http://www.nytimes.com/interactive/2015/04/15/travel/europe-favorite-streets.html',
});

But that does nothing on the mobile device. I also tried:

fb://messaging/compose/new

That did open the message dialog but I can't find an URI for sharing an url.

I wonder if this is even possible?

like image 935
Christophe Avatar asked Jan 08 '16 11:01

Christophe


People also ask

How do I share a link on Facebook Messenger?

At the top of your chat, tap the conversation's name. Tap Invite Link. Tap Copy and send the link to someone or select another way to share the link.


2 Answers

This is what you are looking for:

Link:

<a href="fb-messenger://share/?link= https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fsharing%2Freference%2Fsend-dialog&app_id=123456789">Send In Messenger</a>

JavaScript:

window.open('fb-messenger://share?link=' + encodeURIComponent(link) + '&app_id=' + encodeURIComponent(app_id));

Please note: This will only work on mobile devices. For more information see here:

https://developers.facebook.com/docs/sharing/messenger/web

like image 200
Milen Kovachev Avatar answered Sep 21 '22 00:09

Milen Kovachev


You can use the Send Dialog, which is not supported on mobile: https://developers.facebook.com/docs/sharing/reference/send-dialog#examples

Alternative for mobile: https://developers.facebook.com/docs/sharing/messenger

like image 23
andyrandy Avatar answered Sep 19 '22 00:09

andyrandy